diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml
index dc87c2ab..de5f9cc3 100644
--- a/.github/workflows/Documentation.yml
+++ b/.github/workflows/Documentation.yml
@@ -1,12 +1,12 @@
 name: Documentation
 on:
+  merge_group:
+  pull_request:
   push:
     branches:
       - main
-      - staging
-      - trying
     tags: '*'
-  pull_request:
+  workflow_dispatch:
 
 jobs:
   docs-build:
@@ -21,7 +21,7 @@ jobs:
       - name: Use Github Registry
         run: julia -e 'using Pkg; Pkg.Registry.rm("General"); Pkg.Registry.add(RegistrySpec(url="https://github.com/JuliaRegistries/General"))'
       - name: Install Dependencies
-        run: julia --project=docs/ -e 'ENV["PYTHON"]=""; using Pkg; Pkg.instantiate();'
+        run: julia --project=docs/ -e 'using Pkg; Pkg.develop(path="."); Pkg.instantiate();'
       - name: Build and deploy
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/Example.yml b/.github/workflows/Example.yml
index 381ce540..76696bc7 100644
--- a/.github/workflows/Example.yml
+++ b/.github/workflows/Example.yml
@@ -1,8 +1,8 @@
 name: Example
 on:
+  merge_group:
   pull_request:
-    branches:
-      - v0.1
+  workflow_dispatch:
 
 jobs:
   test:
@@ -16,11 +16,8 @@ jobs:
         with:
           version: "1"
       - name: Use Github Registry
-        run: |
-          cd examples
-          julia -e 'using Pkg; Pkg.Registry.rm("General"); Pkg.Registry.add(RegistrySpec(url="https://github.com/JuliaRegistries/General"))'
-          julia --project -e 'ENV["PYTHON"]=""; using Pkg; Pkg.instantiate();'
+        run: julia -e 'using Pkg; Pkg.Registry.rm("General"); Pkg.Registry.add(RegistrySpec(url="https://github.com/JuliaRegistries/General"))'
+      - name: Install Dependencies
+        run: julia --project=examples/ -e 'using Pkg; Pkg.develop(path="."); Pkg.instantiate();'
       - name: Run Tests
-        run: |
-          cd examples
-          julia --project example.jl
+        run: julia --project=examples/ examples/example.jl
diff --git a/.github/workflows/JuliaStable.yml b/.github/workflows/JuliaStable.yml
index 9e26e674..6574da12 100644
--- a/.github/workflows/JuliaStable.yml
+++ b/.github/workflows/JuliaStable.yml
@@ -1,11 +1,8 @@
 name: JuliaStable
 on:
-  push:
-    branches:
-      - main
-      - staging
-      - trying
+  merge_group:
   pull_request:
+  workflow_dispatch:
 
 jobs:
   test:
@@ -29,11 +26,11 @@ jobs:
         if: runner.os != 'Windows'
         run: |
           julia -e 'using Pkg; Pkg.Registry.rm("General"); Pkg.Registry.add(RegistrySpec(url="https://github.com/JuliaRegistries/General"))'
-          julia --project -e 'ENV["PYTHON"]=""; using Pkg; Pkg.instantiate();'
+          julia --project -e 'using Pkg; Pkg.instantiate();'
       - name: Use Github Registry for Windows
         if: runner.os == 'Windows'
         run: |
           julia -e 'using Pkg; Pkg.Registry.rm(\"General\"); Pkg.Registry.add(RegistrySpec(url=\"https://github.com/JuliaRegistries/General\"))'
-          julia --project -e 'ENV[\"PYTHON\"]=\"\"; using Pkg; Pkg.instantiate();'
+          julia --project -e 'using Pkg; Pkg.instantiate();'
       - name: Run Tests
         uses: julia-actions/julia-runtest@latest
diff --git a/.gitignore b/.gitignore
index 2fbd2138..47969ec5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,5 +22,6 @@ docs/site/
 # committed for packages, but should be committed for applications that require a static
 # environment.
 Manifest.toml
-!/docs/Manifest.toml
-!/examples/Manifest.toml
+
+# Data files
+*.nc
diff --git a/Artifacts.toml b/Artifacts.toml
index 9aec8825..1a4c598a 100644
--- a/Artifacts.toml
+++ b/Artifacts.toml
@@ -21,3 +21,51 @@ lazy = true
     [[land_model_spectrum_V1.download]]
     sha256 = "ee0ee97c013317d5535868db08a0929e4f5dbaef2d2003ed61485003e5302386"
     url = "https://github.com/Yujie-W/ResearchArtifacts/raw/wyujie/LandModel/land_model_spectrum_V1.tar.gz"
+
+[land_model_spectrum_V2]
+git-tree-sha1 = "1f4166dcc30f0cc923ec2889bad8461ef56ec02c"
+lazy = true
+
+    [[land_model_spectrum_V2.download]]
+    sha256 = "d749c1f39a3faf8c403aac2652e7d0643e9386ee36c0dde3ce14f4f003c14113"
+    url = "https://github.com/Yujie-W/ResearchArtifacts/raw/wyujie/LandModel/land_model_spectrum_V2.tar.gz"
+
+[land_model_spectrum_V3]
+git-tree-sha1 = "dbe65e9a8b34c1a0275dfd59e49212f8c634c11c"
+lazy = true
+
+    [[land_model_spectrum_V3.download]]
+    sha256 = "44b04f7ed12f6bf26079cf5357906ea0a209c32858d0e155e195b9843e7a3ed5"
+    url = "https://github.com/Yujie-W/ResearchArtifacts/raw/wyujie/LandModel/land_model_spectrum_V3.tar.gz"
+
+[land_model_spectrum_V4]
+git-tree-sha1 = "140b1602b17415a91305c17d2b413069fc0e7bb3"
+lazy = true
+
+    [[land_model_spectrum_V4.download]]
+    sha256 = "5610ba5463f0fece3829809a1b0ac13eb42eafbae10ef067ed4991a1a775ef10"
+    url = "https://github.com/Yujie-W/ResearchArtifacts/raw/wyujie/LandModel/land_model_spectrum_V4.tar.gz"
+
+[land_model_spectrum_V5]
+git-tree-sha1 = "2ade9a49cc8cab3824956ab0f82642b313dea34b"
+lazy = true
+
+    [[land_model_spectrum_V5.download]]
+    sha256 = "5ef71ae8d69aeebe0a556dfdceace7a05090f835a8e825087f7f2fef9a7b879c"
+    url = "https://github.com/Yujie-W/ResearchArtifacts/raw/wyujie/LandModel/land_model_spectrum_V5.tar.gz"
+
+[land_model_spectrum_V6]
+git-tree-sha1 = "ec3c0df7002c8ddaaa9c6918420b0328a0b10b58"
+lazy = true
+
+    [[land_model_spectrum_V6.download]]
+    sha256 = "9586eeb10323499a76d090a927c9ff618e9f305508ff34973f4bc6392df2df94"
+    url = "https://github.com/Yujie-W/ResearchArtifacts/raw/wyujie/LandModel/land_model_spectrum_V6.tar.gz"
+
+[land_model_spectrum_V7]
+git-tree-sha1 = "d22e6384201ef24aa6c627a9415db891a12fc470"
+lazy = true
+
+    [[land_model_spectrum_V7.download]]
+    sha256 = "ef6ef737e43c4a1ca6106c6a7883f2833ca2770b7f9c4644ec7b5fafb1cf3b26"
+    url = "https://github.com/Yujie-W/ResearchArtifacts/raw/wyujie/LandModel/land_model_spectrum_V7.tar.gz"
diff --git a/Manifest.toml b/Manifest.toml
deleted file mode 100644
index 57036f76..00000000
--- a/Manifest.toml
+++ /dev/null
@@ -1,505 +0,0 @@
-# This file is machine-generated - editing it directly is not advised
-
-julia_version = "1.8.2"
-manifest_format = "2.0"
-project_hash = "82027e4f88c93954b6ab18f920cc9bcd07d7981e"
-
-[[deps.ArgTools]]
-uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
-version = "1.1.1"
-
-[[deps.Artifacts]]
-uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
-
-[[deps.Base64]]
-uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
-
-[[deps.BufferedStreams]]
-git-tree-sha1 = "bb065b14d7f941b8617bc323063dbe79f55d16ea"
-uuid = "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d"
-version = "1.1.0"
-
-[[deps.CSV]]
-deps = ["CodecZlib", "Dates", "FilePathsBase", "InlineStrings", "Mmap", "Parsers", "PooledArrays", "SentinelArrays", "Tables", "Unicode", "WeakRefStrings"]
-git-tree-sha1 = "c5fd7cd27ac4aed0acf4b73948f0110ff2a854b2"
-uuid = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
-version = "0.10.7"
-
-[[deps.Calculus]]
-deps = ["LinearAlgebra"]
-git-tree-sha1 = "f641eb0a4f00c343bbc32346e1217b86f3ce9dad"
-uuid = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9"
-version = "0.5.1"
-
-[[deps.ChainRulesCore]]
-deps = ["Compat", "LinearAlgebra", "SparseArrays"]
-git-tree-sha1 = "e7ff6cadf743c098e08fca25c91103ee4303c9bb"
-uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
-version = "1.15.6"
-
-[[deps.ChangesOfVariables]]
-deps = ["ChainRulesCore", "LinearAlgebra", "Test"]
-git-tree-sha1 = "38f7a08f19d8810338d4f5085211c7dfa5d5bdd8"
-uuid = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0"
-version = "0.1.4"
-
-[[deps.CodecZlib]]
-deps = ["TranscodingStreams", "Zlib_jll"]
-git-tree-sha1 = "ded953804d019afa9a3f98981d99b33e3db7b6da"
-uuid = "944b1d66-785c-5afd-91f1-9de20f533193"
-version = "0.7.0"
-
-[[deps.Compat]]
-deps = ["Dates", "LinearAlgebra", "UUIDs"]
-git-tree-sha1 = "3ca828fe1b75fa84b021a7860bd039eaea84d2f2"
-uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
-version = "4.3.0"
-
-[[deps.CompilerSupportLibraries_jll]]
-deps = ["Artifacts", "Libdl"]
-uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
-version = "0.5.2+0"
-
-[[deps.ConstrainedRootSolvers]]
-deps = ["DocStringExtensions", "PkgUtility", "Test", "UnPack"]
-git-tree-sha1 = "26fb23009728099595c4d47c2028f0f9ef161122"
-uuid = "7e2492bd-0955-4089-8696-9df2af57a479"
-version = "0.1.5"
-
-[[deps.Crayons]]
-git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15"
-uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
-version = "4.1.1"
-
-[[deps.DataAPI]]
-git-tree-sha1 = "46d2680e618f8abd007bce0c3026cb0c4a8f2032"
-uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
-version = "1.12.0"
-
-[[deps.DataFrames]]
-deps = ["Compat", "DataAPI", "Future", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrettyTables", "Printf", "REPL", "Random", "Reexport", "SnoopPrecompile", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"]
-git-tree-sha1 = "5b93f1b47eec9b7194814e40542752418546679f"
-uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
-version = "1.4.2"
-
-[[deps.DataStructures]]
-deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
-git-tree-sha1 = "d1fff3a548102f48987a52a2e0d114fa97d730f0"
-uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
-version = "0.18.13"
-
-[[deps.DataValueInterfaces]]
-git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
-uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464"
-version = "1.0.0"
-
-[[deps.Dates]]
-deps = ["Printf"]
-uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
-
-[[deps.DocStringExtensions]]
-deps = ["LibGit2"]
-git-tree-sha1 = "c36550cb29cbe373e95b3f40486b9a4148f89ffd"
-uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
-version = "0.9.2"
-
-[[deps.Downloads]]
-deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"]
-uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
-version = "1.6.0"
-
-[[deps.DualNumbers]]
-deps = ["Calculus", "NaNMath", "SpecialFunctions"]
-git-tree-sha1 = "5837a837389fccf076445fce071c8ddaea35a566"
-uuid = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"
-version = "0.6.8"
-
-[[deps.EmeraldConstants]]
-deps = ["DocStringExtensions", "Test"]
-git-tree-sha1 = "fff28dae7585fbe4c2a7645edb08baca0f800556"
-uuid = "f1e47f7f-56cf-4a63-9b2b-695e95ad7a29"
-version = "0.1.0"
-
-[[deps.FilePathsBase]]
-deps = ["Compat", "Dates", "Mmap", "Printf", "Test", "UUIDs"]
-git-tree-sha1 = "e27c4ebe80e8699540f2d6c805cc12203b614f12"
-uuid = "48062228-2e41-5def-b9a4-89aafe57970f"
-version = "0.9.20"
-
-[[deps.FileWatching]]
-uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
-
-[[deps.Formatting]]
-deps = ["Printf"]
-git-tree-sha1 = "8339d61043228fdd3eb658d86c926cb282ae72a8"
-uuid = "59287772-0a20-5a39-b81b-1366585eb4c0"
-version = "0.4.2"
-
-[[deps.Future]]
-deps = ["Random"]
-uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"
-
-[[deps.HDF5]]
-deps = ["Compat", "HDF5_jll", "Libdl", "Mmap", "Random", "Requires"]
-git-tree-sha1 = "19effd6b5af759c8aaeb9c77f89422d3f975ab65"
-uuid = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
-version = "0.16.12"
-
-[[deps.HDF5_jll]]
-deps = ["Artifacts", "JLLWrappers", "LibCURL_jll", "Libdl", "OpenSSL_jll", "Pkg", "Zlib_jll"]
-git-tree-sha1 = "4cc2bb72df6ff40b055295fdef6d92955f9dede8"
-uuid = "0234f1f7-429e-5d53-9886-15a909be8d59"
-version = "1.12.2+2"
-
-[[deps.HypergeometricFunctions]]
-deps = ["DualNumbers", "LinearAlgebra", "OpenLibm_jll", "SpecialFunctions", "Test"]
-git-tree-sha1 = "709d864e3ed6e3545230601f94e11ebc65994641"
-uuid = "34004b35-14d8-5ef3-9330-4cdb6864b03a"
-version = "0.3.11"
-
-[[deps.InlineStrings]]
-deps = ["Parsers"]
-git-tree-sha1 = "a62189e59d33e1615feb7a48c0bea7c11e4dc61d"
-uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48"
-version = "1.3.0"
-
-[[deps.InteractiveUtils]]
-deps = ["Markdown"]
-uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
-
-[[deps.InverseFunctions]]
-deps = ["Test"]
-git-tree-sha1 = "49510dfcb407e572524ba94aeae2fced1f3feb0f"
-uuid = "3587e190-3f89-42d0-90ee-14403ec27112"
-version = "0.1.8"
-
-[[deps.InvertedIndices]]
-git-tree-sha1 = "bee5f1ef5bf65df56bdd2e40447590b272a5471f"
-uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f"
-version = "1.1.0"
-
-[[deps.IrrationalConstants]]
-git-tree-sha1 = "7fd44fd4ff43fc60815f8e764c0f352b83c49151"
-uuid = "92d709cd-6900-40b7-9082-c6be49f344b6"
-version = "0.1.1"
-
-[[deps.IteratorInterfaceExtensions]]
-git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856"
-uuid = "82899510-4779-5014-852e-03e436cf321d"
-version = "1.0.0"
-
-[[deps.JLLWrappers]]
-deps = ["Preferences"]
-git-tree-sha1 = "abc9885a7ca2052a736a600f7fa66209f96506e1"
-uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
-version = "1.4.1"
-
-[[deps.LazyArtifacts]]
-deps = ["Artifacts", "Pkg"]
-uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
-
-[[deps.LibCURL]]
-deps = ["LibCURL_jll", "MozillaCACerts_jll"]
-uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
-version = "0.6.3"
-
-[[deps.LibCURL_jll]]
-deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
-uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
-version = "7.84.0+0"
-
-[[deps.LibGit2]]
-deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
-uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
-
-[[deps.LibSSH2_jll]]
-deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
-uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
-version = "1.10.2+0"
-
-[[deps.Libdl]]
-uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
-
-[[deps.LinearAlgebra]]
-deps = ["Libdl", "libblastrampoline_jll"]
-uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
-
-[[deps.LogExpFunctions]]
-deps = ["ChainRulesCore", "ChangesOfVariables", "DocStringExtensions", "InverseFunctions", "IrrationalConstants", "LinearAlgebra"]
-git-tree-sha1 = "94d9c52ca447e23eac0c0f074effbcd38830deb5"
-uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
-version = "0.3.18"
-
-[[deps.Logging]]
-uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
-
-[[deps.MAT]]
-deps = ["BufferedStreams", "CodecZlib", "HDF5", "SparseArrays"]
-git-tree-sha1 = "971be550166fe3f604d28715302b58a3f7293160"
-uuid = "23992714-dd62-5051-b70f-ba57cb901cac"
-version = "0.10.3"
-
-[[deps.Markdown]]
-deps = ["Base64"]
-uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
-
-[[deps.MbedTLS_jll]]
-deps = ["Artifacts", "Libdl"]
-uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
-version = "2.28.0+0"
-
-[[deps.Missings]]
-deps = ["DataAPI"]
-git-tree-sha1 = "bf210ce90b6c9eed32d25dbcae1ebc565df2687f"
-uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
-version = "1.0.2"
-
-[[deps.Mmap]]
-uuid = "a63ad114-7e13-5084-954f-fe012c677804"
-
-[[deps.MozillaCACerts_jll]]
-uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
-version = "2022.2.1"
-
-[[deps.NaNMath]]
-deps = ["OpenLibm_jll"]
-git-tree-sha1 = "a7c3d1da1189a1c2fe843a3bfa04d18d20eb3211"
-uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
-version = "1.0.1"
-
-[[deps.NetworkOptions]]
-uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
-version = "1.2.0"
-
-[[deps.OpenBLAS_jll]]
-deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"]
-uuid = "4536629a-c528-5b80-bd46-f80d51c5b363"
-version = "0.3.20+0"
-
-[[deps.OpenLibm_jll]]
-deps = ["Artifacts", "Libdl"]
-uuid = "05823500-19ac-5b8b-9628-191a04bc5112"
-version = "0.8.1+0"
-
-[[deps.OpenSSL_jll]]
-deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
-git-tree-sha1 = "e60321e3f2616584ff98f0a4f18d98ae6f89bbb3"
-uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
-version = "1.1.17+0"
-
-[[deps.OpenSpecFun_jll]]
-deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"]
-git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1"
-uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e"
-version = "0.5.5+0"
-
-[[deps.OrderedCollections]]
-git-tree-sha1 = "85f8e6578bf1f9ee0d11e7bb1b1456435479d47c"
-uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
-version = "1.4.1"
-
-[[deps.Parsers]]
-deps = ["Dates"]
-git-tree-sha1 = "6c01a9b494f6d2a9fc180a08b182fcb06f0958a0"
-uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
-version = "2.4.2"
-
-[[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"
-version = "1.8.0"
-
-[[deps.PkgUtility]]
-deps = ["Dates", "LazyArtifacts", "Pkg", "Statistics", "StatsBase", "Test"]
-git-tree-sha1 = "968844493dfb3c8f6cf6f420f07d926508836b5d"
-uuid = "0d262f2c-28e9-492c-8e19-d7a5c4f11611"
-version = "0.2.1"
-
-[[deps.PooledArrays]]
-deps = ["DataAPI", "Future"]
-git-tree-sha1 = "a6062fe4063cdafe78f4a0a81cfffb89721b30e7"
-uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720"
-version = "1.4.2"
-
-[[deps.Preferences]]
-deps = ["TOML"]
-git-tree-sha1 = "47e5f437cc0e7ef2ce8406ce1e7e24d44915f88d"
-uuid = "21216c6a-2e73-6563-6e65-726566657250"
-version = "1.3.0"
-
-[[deps.PrettyTables]]
-deps = ["Crayons", "Formatting", "Markdown", "Reexport", "StringManipulation", "Tables"]
-git-tree-sha1 = "460d9e154365e058c4d886f6f7d6df5ffa1ea80e"
-uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
-version = "2.1.2"
-
-[[deps.Printf]]
-deps = ["Unicode"]
-uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
-
-[[deps.QuadGK]]
-deps = ["DataStructures", "LinearAlgebra"]
-git-tree-sha1 = "97aa253e65b784fd13e83774cadc95b38011d734"
-uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
-version = "2.6.0"
-
-[[deps.REPL]]
-deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
-uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
-
-[[deps.Random]]
-deps = ["SHA", "Serialization"]
-uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
-
-[[deps.Reexport]]
-git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b"
-uuid = "189a3867-3050-52da-a836-e630ba90ab69"
-version = "1.2.2"
-
-[[deps.Requires]]
-deps = ["UUIDs"]
-git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7"
-uuid = "ae029012-a4dd-5104-9daa-d747884805df"
-version = "1.3.0"
-
-[[deps.SHA]]
-uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
-version = "0.7.0"
-
-[[deps.SentinelArrays]]
-deps = ["Dates", "Random"]
-git-tree-sha1 = "efd23b378ea5f2db53a55ae53d3133de4e080aa9"
-uuid = "91c51154-3ec4-41a3-a24f-3f23e20d615c"
-version = "1.3.16"
-
-[[deps.Serialization]]
-uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
-
-[[deps.SnoopPrecompile]]
-git-tree-sha1 = "f604441450a3c0569830946e5b33b78c928e1a85"
-uuid = "66db9d55-30c0-4569-8b51-7e840670fc0c"
-version = "1.0.1"
-
-[[deps.Sockets]]
-uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
-
-[[deps.SortingAlgorithms]]
-deps = ["DataStructures"]
-git-tree-sha1 = "b3363d7460f7d098ca0912c69b082f75625d7508"
-uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c"
-version = "1.0.1"
-
-[[deps.SparseArrays]]
-deps = ["LinearAlgebra", "Random"]
-uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
-
-[[deps.SpecialFunctions]]
-deps = ["ChainRulesCore", "IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"]
-git-tree-sha1 = "d75bda01f8c31ebb72df80a46c88b25d1c79c56d"
-uuid = "276daf66-3868-5448-9aa4-cd146d93841b"
-version = "2.1.7"
-
-[[deps.Statistics]]
-deps = ["LinearAlgebra", "SparseArrays"]
-uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
-
-[[deps.StatsAPI]]
-deps = ["LinearAlgebra"]
-git-tree-sha1 = "f9af7f195fb13589dd2e2d57fdb401717d2eb1f6"
-uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0"
-version = "1.5.0"
-
-[[deps.StatsBase]]
-deps = ["DataAPI", "DataStructures", "LinearAlgebra", "LogExpFunctions", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"]
-git-tree-sha1 = "d1bf48bfcc554a3761a133fe3a9bb01488e06916"
-uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
-version = "0.33.21"
-
-[[deps.StringManipulation]]
-git-tree-sha1 = "46da2434b41f41ac3594ee9816ce5541c6096123"
-uuid = "892a3eda-7b42-436c-8928-eab12a02cf0e"
-version = "0.3.0"
-
-[[deps.TOML]]
-deps = ["Dates"]
-uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
-version = "1.0.0"
-
-[[deps.TableTraits]]
-deps = ["IteratorInterfaceExtensions"]
-git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39"
-uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c"
-version = "1.0.1"
-
-[[deps.Tables]]
-deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits", "Test"]
-git-tree-sha1 = "c79322d36826aa2f4fd8ecfa96ddb47b174ac78d"
-uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
-version = "1.10.0"
-
-[[deps.Tar]]
-deps = ["ArgTools", "SHA"]
-uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
-version = "1.10.1"
-
-[[deps.Test]]
-deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
-uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
-
-[[deps.TextIO]]
-deps = ["CSV", "DataFrames", "Test"]
-git-tree-sha1 = "25418339f316f8f3c9f3c7ba78d574f713c45d5e"
-repo-rev = "wyujie"
-repo-url = "https://github.com/Yujie-W/TextIO.jl"
-uuid = "52be8cd1-7bc6-40f3-9b52-aa7544d4b77d"
-version = "0.1.0"
-
-[[deps.TranscodingStreams]]
-deps = ["Random", "Test"]
-git-tree-sha1 = "8a75929dcd3c38611db2f8d08546decb514fcadf"
-uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
-version = "0.9.9"
-
-[[deps.UUIDs]]
-deps = ["Random", "SHA"]
-uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
-
-[[deps.UnPack]]
-git-tree-sha1 = "387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b"
-uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
-version = "1.0.2"
-
-[[deps.Unicode]]
-uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
-
-[[deps.WaterPhysics]]
-deps = ["DocStringExtensions", "EmeraldConstants", "PkgUtility", "Test", "UnPack"]
-git-tree-sha1 = "2ca56b50c07bb8d6e6c214c8dabafb97cad479bf"
-uuid = "20dd5ee6-61da-454b-ac5d-c09c2977e03a"
-version = "0.1.5"
-
-[[deps.WeakRefStrings]]
-deps = ["DataAPI", "InlineStrings", "Parsers"]
-git-tree-sha1 = "b1be2855ed9ed8eac54e5caff2afcdb442d52c23"
-uuid = "ea10d353-3f73-51f8-a26c-33c1cb351aa5"
-version = "1.4.2"
-
-[[deps.Zlib_jll]]
-deps = ["Libdl"]
-uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
-version = "1.2.12+3"
-
-[[deps.libblastrampoline_jll]]
-deps = ["Artifacts", "Libdl", "OpenBLAS_jll"]
-uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
-version = "5.1.1+0"
-
-[[deps.nghttp2_jll]]
-deps = ["Artifacts", "Libdl"]
-uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
-version = "1.48.0+0"
-
-[[deps.p7zip_jll]]
-deps = ["Artifacts", "Libdl"]
-uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"
-version = "17.4.0+0"
diff --git a/Project.toml b/Project.toml
index 868c861d..3d20b022 100644
--- a/Project.toml
+++ b/Project.toml
@@ -1,38 +1,32 @@
 name = "Land"
 uuid = "27e3c115-2cb8-4114-b7a5-cd9f011f9dcc"
-authors = ["Charles Kawczynski <kawczynski.charles@gmail.com>"]
-version = "0.1.0"
+authors = ["CliMA Land Team"]
+version = "0.1.1"
 
 [deps]
 ConstrainedRootSolvers = "7e2492bd-0955-4089-8696-9df2af57a479"
-DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
 DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
 EmeraldConstants = "f1e47f7f-56cf-4a63-9b2b-695e95ad7a29"
 HypergeometricFunctions = "34004b35-14d8-5ef3-9330-4cdb6864b03a"
 LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
 LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
-MAT = "23992714-dd62-5051-b70f-ba57cb901cac"
-Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
+NetcdfIO = "6a36f34d-89cf-423a-87c4-84549e82f670"
 PkgUtility = "0d262f2c-28e9-492c-8e19-d7a5c4f11611"
 QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
+Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
 SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
 Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
 Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
-TextIO = "52be8cd1-7bc6-40f3-9b52-aa7544d4b77d"
-UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
 WaterPhysics = "20dd5ee6-61da-454b-ac5d-c09c2977e03a"
 
 [compat]
 ConstrainedRootSolvers = "0.1.5"
-DataFrames = "1.4.2"
 DocStringExtensions = "0.9.2"
 EmeraldConstants = "0.1.0"
 HypergeometricFunctions = "0.3.11"
-MAT = "0.10.3"
 PkgUtility = "0.2.1"
 QuadGK = "2.6.0"
+Revise = "3.5.1"
 SpecialFunctions = "2.1.7"
-TextIO = "0.1.0"
-UnPack = "1.0.2"
 WaterPhysics = "0.1.5"
-julia = "1.6"
+julia = "1.7"
diff --git a/bors.toml b/bors.toml
deleted file mode 100644
index be5d5874..00000000
--- a/bors.toml
+++ /dev/null
@@ -1,11 +0,0 @@
-status = [
-    "clean-notebooks",
-    "docs-build",
-    "macos-latest",
-    "ubuntu-latest",
-    "windows-latest"
-]
-delete_merged_branches = true
-timeout_sec = 86400
-block_labels = [ "do-not-merge-yet" ]
-cut_body_after = "<!--"
diff --git a/docs/Manifest.toml b/docs/Manifest.toml
deleted file mode 100644
index 1a85d35b..00000000
--- a/docs/Manifest.toml
+++ /dev/null
@@ -1,534 +0,0 @@
-# This file is machine-generated - editing it directly is not advised
-
-julia_version = "1.8.2"
-manifest_format = "2.0"
-project_hash = "7286398fd47a435ee3d1693e1c1398957b16f990"
-
-[[deps.ANSIColoredPrinters]]
-git-tree-sha1 = "574baf8110975760d391c710b6341da1afa48d8c"
-uuid = "a4c015fc-c6ff-483c-b24f-f7ea428134e9"
-version = "0.0.1"
-
-[[deps.ArgTools]]
-uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
-version = "1.1.1"
-
-[[deps.Artifacts]]
-uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
-
-[[deps.Base64]]
-uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
-
-[[deps.BufferedStreams]]
-git-tree-sha1 = "bb065b14d7f941b8617bc323063dbe79f55d16ea"
-uuid = "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d"
-version = "1.1.0"
-
-[[deps.CSV]]
-deps = ["CodecZlib", "Dates", "FilePathsBase", "InlineStrings", "Mmap", "Parsers", "PooledArrays", "SentinelArrays", "Tables", "Unicode", "WeakRefStrings"]
-git-tree-sha1 = "c5fd7cd27ac4aed0acf4b73948f0110ff2a854b2"
-uuid = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
-version = "0.10.7"
-
-[[deps.Calculus]]
-deps = ["LinearAlgebra"]
-git-tree-sha1 = "f641eb0a4f00c343bbc32346e1217b86f3ce9dad"
-uuid = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9"
-version = "0.5.1"
-
-[[deps.ChainRulesCore]]
-deps = ["Compat", "LinearAlgebra", "SparseArrays"]
-git-tree-sha1 = "e7ff6cadf743c098e08fca25c91103ee4303c9bb"
-uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
-version = "1.15.6"
-
-[[deps.ChangesOfVariables]]
-deps = ["ChainRulesCore", "LinearAlgebra", "Test"]
-git-tree-sha1 = "38f7a08f19d8810338d4f5085211c7dfa5d5bdd8"
-uuid = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0"
-version = "0.1.4"
-
-[[deps.CodecZlib]]
-deps = ["TranscodingStreams", "Zlib_jll"]
-git-tree-sha1 = "ded953804d019afa9a3f98981d99b33e3db7b6da"
-uuid = "944b1d66-785c-5afd-91f1-9de20f533193"
-version = "0.7.0"
-
-[[deps.Compat]]
-deps = ["Dates", "LinearAlgebra", "UUIDs"]
-git-tree-sha1 = "3ca828fe1b75fa84b021a7860bd039eaea84d2f2"
-uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
-version = "4.3.0"
-
-[[deps.CompilerSupportLibraries_jll]]
-deps = ["Artifacts", "Libdl"]
-uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
-version = "0.5.2+0"
-
-[[deps.ConstrainedRootSolvers]]
-deps = ["DocStringExtensions", "PkgUtility", "Test", "UnPack"]
-git-tree-sha1 = "26fb23009728099595c4d47c2028f0f9ef161122"
-uuid = "7e2492bd-0955-4089-8696-9df2af57a479"
-version = "0.1.5"
-
-[[deps.Crayons]]
-git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15"
-uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
-version = "4.1.1"
-
-[[deps.DataAPI]]
-git-tree-sha1 = "46d2680e618f8abd007bce0c3026cb0c4a8f2032"
-uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
-version = "1.12.0"
-
-[[deps.DataFrames]]
-deps = ["Compat", "DataAPI", "Future", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrettyTables", "Printf", "REPL", "Random", "Reexport", "SnoopPrecompile", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"]
-git-tree-sha1 = "5b93f1b47eec9b7194814e40542752418546679f"
-uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
-version = "1.4.2"
-
-[[deps.DataStructures]]
-deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
-git-tree-sha1 = "d1fff3a548102f48987a52a2e0d114fa97d730f0"
-uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
-version = "0.18.13"
-
-[[deps.DataValueInterfaces]]
-git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
-uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464"
-version = "1.0.0"
-
-[[deps.Dates]]
-deps = ["Printf"]
-uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
-
-[[deps.DocStringExtensions]]
-deps = ["LibGit2"]
-git-tree-sha1 = "c36550cb29cbe373e95b3f40486b9a4148f89ffd"
-uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
-version = "0.9.2"
-
-[[deps.Documenter]]
-deps = ["ANSIColoredPrinters", "Base64", "Dates", "DocStringExtensions", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"]
-git-tree-sha1 = "6030186b00a38e9d0434518627426570aac2ef95"
-uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
-version = "0.27.23"
-
-[[deps.Downloads]]
-deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"]
-uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
-version = "1.6.0"
-
-[[deps.DualNumbers]]
-deps = ["Calculus", "NaNMath", "SpecialFunctions"]
-git-tree-sha1 = "5837a837389fccf076445fce071c8ddaea35a566"
-uuid = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"
-version = "0.6.8"
-
-[[deps.EmeraldConstants]]
-deps = ["DocStringExtensions", "Test"]
-git-tree-sha1 = "fff28dae7585fbe4c2a7645edb08baca0f800556"
-uuid = "f1e47f7f-56cf-4a63-9b2b-695e95ad7a29"
-version = "0.1.0"
-
-[[deps.FilePathsBase]]
-deps = ["Compat", "Dates", "Mmap", "Printf", "Test", "UUIDs"]
-git-tree-sha1 = "e27c4ebe80e8699540f2d6c805cc12203b614f12"
-uuid = "48062228-2e41-5def-b9a4-89aafe57970f"
-version = "0.9.20"
-
-[[deps.FileWatching]]
-uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
-
-[[deps.Formatting]]
-deps = ["Printf"]
-git-tree-sha1 = "8339d61043228fdd3eb658d86c926cb282ae72a8"
-uuid = "59287772-0a20-5a39-b81b-1366585eb4c0"
-version = "0.4.2"
-
-[[deps.Future]]
-deps = ["Random"]
-uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"
-
-[[deps.HDF5]]
-deps = ["Compat", "HDF5_jll", "Libdl", "Mmap", "Random", "Requires"]
-git-tree-sha1 = "19effd6b5af759c8aaeb9c77f89422d3f975ab65"
-uuid = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
-version = "0.16.12"
-
-[[deps.HDF5_jll]]
-deps = ["Artifacts", "JLLWrappers", "LibCURL_jll", "Libdl", "OpenSSL_jll", "Pkg", "Zlib_jll"]
-git-tree-sha1 = "4cc2bb72df6ff40b055295fdef6d92955f9dede8"
-uuid = "0234f1f7-429e-5d53-9886-15a909be8d59"
-version = "1.12.2+2"
-
-[[deps.HypergeometricFunctions]]
-deps = ["DualNumbers", "LinearAlgebra", "OpenLibm_jll", "SpecialFunctions", "Test"]
-git-tree-sha1 = "709d864e3ed6e3545230601f94e11ebc65994641"
-uuid = "34004b35-14d8-5ef3-9330-4cdb6864b03a"
-version = "0.3.11"
-
-[[deps.IOCapture]]
-deps = ["Logging", "Random"]
-git-tree-sha1 = "f7be53659ab06ddc986428d3a9dcc95f6fa6705a"
-uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89"
-version = "0.2.2"
-
-[[deps.InlineStrings]]
-deps = ["Parsers"]
-git-tree-sha1 = "a62189e59d33e1615feb7a48c0bea7c11e4dc61d"
-uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48"
-version = "1.3.0"
-
-[[deps.InteractiveUtils]]
-deps = ["Markdown"]
-uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
-
-[[deps.InverseFunctions]]
-deps = ["Test"]
-git-tree-sha1 = "49510dfcb407e572524ba94aeae2fced1f3feb0f"
-uuid = "3587e190-3f89-42d0-90ee-14403ec27112"
-version = "0.1.8"
-
-[[deps.InvertedIndices]]
-git-tree-sha1 = "bee5f1ef5bf65df56bdd2e40447590b272a5471f"
-uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f"
-version = "1.1.0"
-
-[[deps.IrrationalConstants]]
-git-tree-sha1 = "7fd44fd4ff43fc60815f8e764c0f352b83c49151"
-uuid = "92d709cd-6900-40b7-9082-c6be49f344b6"
-version = "0.1.1"
-
-[[deps.IteratorInterfaceExtensions]]
-git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856"
-uuid = "82899510-4779-5014-852e-03e436cf321d"
-version = "1.0.0"
-
-[[deps.JLLWrappers]]
-deps = ["Preferences"]
-git-tree-sha1 = "abc9885a7ca2052a736a600f7fa66209f96506e1"
-uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
-version = "1.4.1"
-
-[[deps.JSON]]
-deps = ["Dates", "Mmap", "Parsers", "Unicode"]
-git-tree-sha1 = "3c837543ddb02250ef42f4738347454f95079d4e"
-uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
-version = "0.21.3"
-
-[[deps.Land]]
-deps = ["ConstrainedRootSolvers", "DataFrames", "DocStringExtensions", "EmeraldConstants", "HypergeometricFunctions", "LazyArtifacts", "LinearAlgebra", "MAT", "Pkg", "PkgUtility", "QuadGK", "SpecialFunctions", "Statistics", "Test", "TextIO", "UnPack", "WaterPhysics"]
-path = ".."
-uuid = "27e3c115-2cb8-4114-b7a5-cd9f011f9dcc"
-version = "0.1.0"
-
-[[deps.LazyArtifacts]]
-deps = ["Artifacts", "Pkg"]
-uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
-
-[[deps.LibCURL]]
-deps = ["LibCURL_jll", "MozillaCACerts_jll"]
-uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
-version = "0.6.3"
-
-[[deps.LibCURL_jll]]
-deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
-uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
-version = "7.84.0+0"
-
-[[deps.LibGit2]]
-deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
-uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
-
-[[deps.LibSSH2_jll]]
-deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
-uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
-version = "1.10.2+0"
-
-[[deps.Libdl]]
-uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
-
-[[deps.LinearAlgebra]]
-deps = ["Libdl", "libblastrampoline_jll"]
-uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
-
-[[deps.LogExpFunctions]]
-deps = ["ChainRulesCore", "ChangesOfVariables", "DocStringExtensions", "InverseFunctions", "IrrationalConstants", "LinearAlgebra"]
-git-tree-sha1 = "94d9c52ca447e23eac0c0f074effbcd38830deb5"
-uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
-version = "0.3.18"
-
-[[deps.Logging]]
-uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
-
-[[deps.MAT]]
-deps = ["BufferedStreams", "CodecZlib", "HDF5", "SparseArrays"]
-git-tree-sha1 = "971be550166fe3f604d28715302b58a3f7293160"
-uuid = "23992714-dd62-5051-b70f-ba57cb901cac"
-version = "0.10.3"
-
-[[deps.Markdown]]
-deps = ["Base64"]
-uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
-
-[[deps.MbedTLS_jll]]
-deps = ["Artifacts", "Libdl"]
-uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
-version = "2.28.0+0"
-
-[[deps.Missings]]
-deps = ["DataAPI"]
-git-tree-sha1 = "bf210ce90b6c9eed32d25dbcae1ebc565df2687f"
-uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
-version = "1.0.2"
-
-[[deps.Mmap]]
-uuid = "a63ad114-7e13-5084-954f-fe012c677804"
-
-[[deps.MozillaCACerts_jll]]
-uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
-version = "2022.2.1"
-
-[[deps.NaNMath]]
-deps = ["OpenLibm_jll"]
-git-tree-sha1 = "a7c3d1da1189a1c2fe843a3bfa04d18d20eb3211"
-uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
-version = "1.0.1"
-
-[[deps.NetworkOptions]]
-uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
-version = "1.2.0"
-
-[[deps.OpenBLAS_jll]]
-deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"]
-uuid = "4536629a-c528-5b80-bd46-f80d51c5b363"
-version = "0.3.20+0"
-
-[[deps.OpenLibm_jll]]
-deps = ["Artifacts", "Libdl"]
-uuid = "05823500-19ac-5b8b-9628-191a04bc5112"
-version = "0.8.1+0"
-
-[[deps.OpenSSL_jll]]
-deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
-git-tree-sha1 = "e60321e3f2616584ff98f0a4f18d98ae6f89bbb3"
-uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
-version = "1.1.17+0"
-
-[[deps.OpenSpecFun_jll]]
-deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"]
-git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1"
-uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e"
-version = "0.5.5+0"
-
-[[deps.OrderedCollections]]
-git-tree-sha1 = "85f8e6578bf1f9ee0d11e7bb1b1456435479d47c"
-uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
-version = "1.4.1"
-
-[[deps.Parsers]]
-deps = ["Dates"]
-git-tree-sha1 = "6c01a9b494f6d2a9fc180a08b182fcb06f0958a0"
-uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
-version = "2.4.2"
-
-[[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"
-version = "1.8.0"
-
-[[deps.PkgUtility]]
-deps = ["Dates", "LazyArtifacts", "Pkg", "Statistics", "StatsBase", "Test"]
-git-tree-sha1 = "968844493dfb3c8f6cf6f420f07d926508836b5d"
-uuid = "0d262f2c-28e9-492c-8e19-d7a5c4f11611"
-version = "0.2.1"
-
-[[deps.PooledArrays]]
-deps = ["DataAPI", "Future"]
-git-tree-sha1 = "a6062fe4063cdafe78f4a0a81cfffb89721b30e7"
-uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720"
-version = "1.4.2"
-
-[[deps.Preferences]]
-deps = ["TOML"]
-git-tree-sha1 = "47e5f437cc0e7ef2ce8406ce1e7e24d44915f88d"
-uuid = "21216c6a-2e73-6563-6e65-726566657250"
-version = "1.3.0"
-
-[[deps.PrettyTables]]
-deps = ["Crayons", "Formatting", "Markdown", "Reexport", "StringManipulation", "Tables"]
-git-tree-sha1 = "460d9e154365e058c4d886f6f7d6df5ffa1ea80e"
-uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
-version = "2.1.2"
-
-[[deps.Printf]]
-deps = ["Unicode"]
-uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
-
-[[deps.QuadGK]]
-deps = ["DataStructures", "LinearAlgebra"]
-git-tree-sha1 = "97aa253e65b784fd13e83774cadc95b38011d734"
-uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
-version = "2.6.0"
-
-[[deps.REPL]]
-deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
-uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
-
-[[deps.Random]]
-deps = ["SHA", "Serialization"]
-uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
-
-[[deps.Reexport]]
-git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b"
-uuid = "189a3867-3050-52da-a836-e630ba90ab69"
-version = "1.2.2"
-
-[[deps.Requires]]
-deps = ["UUIDs"]
-git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7"
-uuid = "ae029012-a4dd-5104-9daa-d747884805df"
-version = "1.3.0"
-
-[[deps.SHA]]
-uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
-version = "0.7.0"
-
-[[deps.SentinelArrays]]
-deps = ["Dates", "Random"]
-git-tree-sha1 = "efd23b378ea5f2db53a55ae53d3133de4e080aa9"
-uuid = "91c51154-3ec4-41a3-a24f-3f23e20d615c"
-version = "1.3.16"
-
-[[deps.Serialization]]
-uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
-
-[[deps.SnoopPrecompile]]
-git-tree-sha1 = "f604441450a3c0569830946e5b33b78c928e1a85"
-uuid = "66db9d55-30c0-4569-8b51-7e840670fc0c"
-version = "1.0.1"
-
-[[deps.Sockets]]
-uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
-
-[[deps.SortingAlgorithms]]
-deps = ["DataStructures"]
-git-tree-sha1 = "b3363d7460f7d098ca0912c69b082f75625d7508"
-uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c"
-version = "1.0.1"
-
-[[deps.SparseArrays]]
-deps = ["LinearAlgebra", "Random"]
-uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
-
-[[deps.SpecialFunctions]]
-deps = ["ChainRulesCore", "IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"]
-git-tree-sha1 = "d75bda01f8c31ebb72df80a46c88b25d1c79c56d"
-uuid = "276daf66-3868-5448-9aa4-cd146d93841b"
-version = "2.1.7"
-
-[[deps.Statistics]]
-deps = ["LinearAlgebra", "SparseArrays"]
-uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
-
-[[deps.StatsAPI]]
-deps = ["LinearAlgebra"]
-git-tree-sha1 = "f9af7f195fb13589dd2e2d57fdb401717d2eb1f6"
-uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0"
-version = "1.5.0"
-
-[[deps.StatsBase]]
-deps = ["DataAPI", "DataStructures", "LinearAlgebra", "LogExpFunctions", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"]
-git-tree-sha1 = "d1bf48bfcc554a3761a133fe3a9bb01488e06916"
-uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
-version = "0.33.21"
-
-[[deps.StringManipulation]]
-git-tree-sha1 = "46da2434b41f41ac3594ee9816ce5541c6096123"
-uuid = "892a3eda-7b42-436c-8928-eab12a02cf0e"
-version = "0.3.0"
-
-[[deps.TOML]]
-deps = ["Dates"]
-uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
-version = "1.0.0"
-
-[[deps.TableTraits]]
-deps = ["IteratorInterfaceExtensions"]
-git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39"
-uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c"
-version = "1.0.1"
-
-[[deps.Tables]]
-deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits", "Test"]
-git-tree-sha1 = "c79322d36826aa2f4fd8ecfa96ddb47b174ac78d"
-uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
-version = "1.10.0"
-
-[[deps.Tar]]
-deps = ["ArgTools", "SHA"]
-uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
-version = "1.10.1"
-
-[[deps.Test]]
-deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
-uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
-
-[[deps.TextIO]]
-deps = ["CSV", "DataFrames", "Test"]
-git-tree-sha1 = "25418339f316f8f3c9f3c7ba78d574f713c45d5e"
-repo-rev = "wyujie"
-repo-url = "https://github.com/Yujie-W/TextIO.jl"
-uuid = "52be8cd1-7bc6-40f3-9b52-aa7544d4b77d"
-version = "0.1.0"
-
-[[deps.TranscodingStreams]]
-deps = ["Random", "Test"]
-git-tree-sha1 = "8a75929dcd3c38611db2f8d08546decb514fcadf"
-uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
-version = "0.9.9"
-
-[[deps.UUIDs]]
-deps = ["Random", "SHA"]
-uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
-
-[[deps.UnPack]]
-git-tree-sha1 = "387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b"
-uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
-version = "1.0.2"
-
-[[deps.Unicode]]
-uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
-
-[[deps.WaterPhysics]]
-deps = ["DocStringExtensions", "EmeraldConstants", "PkgUtility", "Test", "UnPack"]
-git-tree-sha1 = "2ca56b50c07bb8d6e6c214c8dabafb97cad479bf"
-uuid = "20dd5ee6-61da-454b-ac5d-c09c2977e03a"
-version = "0.1.5"
-
-[[deps.WeakRefStrings]]
-deps = ["DataAPI", "InlineStrings", "Parsers"]
-git-tree-sha1 = "b1be2855ed9ed8eac54e5caff2afcdb442d52c23"
-uuid = "ea10d353-3f73-51f8-a26c-33c1cb351aa5"
-version = "1.4.2"
-
-[[deps.Zlib_jll]]
-deps = ["Libdl"]
-uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
-version = "1.2.12+3"
-
-[[deps.libblastrampoline_jll]]
-deps = ["Artifacts", "Libdl", "OpenBLAS_jll"]
-uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
-version = "5.1.1+0"
-
-[[deps.nghttp2_jll]]
-deps = ["Artifacts", "Libdl"]
-uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
-version = "1.48.0+0"
-
-[[deps.p7zip_jll]]
-deps = ["Artifacts", "Libdl"]
-uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"
-version = "17.4.0+0"
diff --git a/docs/Project.toml b/docs/Project.toml
index b44bfb75..af573568 100644
--- a/docs/Project.toml
+++ b/docs/Project.toml
@@ -1,4 +1,3 @@
 [deps]
 Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
 Land = "27e3c115-2cb8-4114-b7a5-cd9f011f9dcc"
-TextIO = "52be8cd1-7bc6-40f3-9b52-aa7544d4b77d"
diff --git a/docs/make.jl b/docs/make.jl
index 96e79c52..b8aa80d1 100644
--- a/docs/make.jl
+++ b/docs/make.jl
@@ -14,7 +14,7 @@ pages = Any[
               "SPAC"            => "submodules/SoilPlantAirContinuum.md",
               "Land"            => "submodules/Land.md"                 ,
     ],
-]
+];
 
 
 # format the docs
@@ -23,29 +23,29 @@ mathengine = MathJax(Dict(
         :equationNumbers => Dict(:autoNumber => "AMS"),
         :Macros => Dict(),
     ),
-))
+));
 
 format = Documenter.HTML(
     prettyurls = get(ENV, "CI", nothing) == "true",
     mathengine = mathengine,
     collapselevel = 1,
     assets = ["assets/favicon.ico"]
-)
+);
 
 
 # build the docs
 makedocs(
-    sitename = "Land",
+    sitename = "clima-land-v0.1",
     format = format,
     clean = false,
-    modules = [Land],
+    # modules = [Land],
     pages = pages,
 )
 
 
 # deploy the docs to Github gh-pages
 deploydocs(
-    repo = "github.com/CliMA/Land.git",
+    repo = "github.com/silicormosia/clima-land-v0.1.git",
     target = "build",
     devbranch = "main",
     push_preview = true,
diff --git a/docs/src/examples/CanopyLayers/bigleaf.jl b/docs/src/examples/CanopyLayers/bigleaf.jl
deleted file mode 100644
index e0c5b4c9..00000000
--- a/docs/src/examples/CanopyLayers/bigleaf.jl
+++ /dev/null
@@ -1,111 +0,0 @@
-# # Big Leaf Model
-
-## load packages
-using Land.CanopyLayers
-using PlotPlants
-FT = Float32;
-#------------------------------------------------------------------------------
-
-
-
-
-# ## Sunlit and shaded layers
-# ### vs. leaf area index
-lais   = collect(FT, 0.1:0.1:5.0);
-lai_sl = similar(lais);
-par_sl = similar(lais); par_sh = similar(lais);
-rad_sl = similar(lais); rad_sh = similar(lais);
-for i in eachindex(lais)
-    lai_sl[i], par_sl[i], par_sh[i], rad_sl[i], rad_sh[i] =
-        big_leaf_partition(lais[i], FT(30), FT(800));
-end
-
-_fig,_axes = create_canvas("vs LAI"; ncol=3);
-_ax1,_ax2,_ax3 = _axes;
-_ax1.plot(lais, lai_sl, "k-");
-_ax2.plot(lais, par_sl, "k-", label="Sunlit");
-_ax2.plot(lais, par_sh, "k:", label="Shaded");
-_ax3.plot(lais, rad_sl, "k-", label="Sunlit");
-_ax3.plot(lais, rad_sh, "k:", label="Shaded");
-_ax2.legend(loc="upper right");
-_ax3.legend(loc="upper right");
-set_xlabels!(_axes, ["Leaf area index" for i in 1:3]);
-set_ylabels!(_axes, ["Sunlit fraction", "PAR (μmol m⁻² s⁻¹)", "Rabs (W m⁻²)"]);
-_fig.set_tight_layout(true);
-_fig
-#------------------------------------------------------------------------------
-
-# ### vs. zenith angle
-angles = collect(FT, 5:5:75);
-lai_sl = similar(angles);
-par_sl = similar(angles); par_sh = similar(angles);
-rad_sl = similar(angles); rad_sh = similar(angles);
-for i in eachindex(angles)
-    lai_sl[i], par_sl[i], par_sh[i], rad_sl[i], rad_sh[i] =
-        big_leaf_partition(FT(3), angles[i], FT(800));
-end
-
-_fig,_axes = create_canvas("vs Zenith angle"; ncol=3);
-_ax1,_ax2,_ax3 = _axes;
-_ax1.plot(angles, lai_sl, "k-");
-_ax2.plot(angles, par_sl, "k-", label="Sunlit");
-_ax2.plot(angles, par_sh, "k:", label="Shaded");
-_ax3.plot(angles, rad_sl, "k-", label="Sunlit");
-_ax3.plot(angles, rad_sh, "k:", label="Shaded");
-_ax2.legend(loc="upper left");
-_ax3.legend(loc="upper left");
-set_xlabels!(_axes, ["Zenith angle (°)" for i in 1:3]);
-set_ylabels!(_axes, ["Sunlit fraction", "PAR (μmol m⁻² s⁻¹)", "Rabs (W m⁻²)"]);
-_fig.set_tight_layout(true);
-_fig
-#------------------------------------------------------------------------------
-
-# ### vs. total radiation
-rads   = collect(FT, 50:50:1000);
-lai_sl = similar(rads);
-par_sl = similar(rads); par_sh = similar(rads);
-rad_sl = similar(rads); rad_sh = similar(rads);
-for i in eachindex(rads)
-    lai_sl[i], par_sl[i], par_sh[i], rad_sl[i], rad_sh[i] =
-        big_leaf_partition(FT(3), FT(30), rads[i]);
-end
-
-_fig,_axes = create_canvas("vs Total radiation"; ncol=3);
-_ax1,_ax2,_ax3 = _axes;
-_ax1.plot(rads, lai_sl, "k-");
-_ax2.plot(rads, par_sl, "k-", label="Sunlit");
-_ax2.plot(rads, par_sh, "k:", label="Shaded");
-_ax3.plot(rads, rad_sl, "k-", label="Sunlit");
-_ax3.plot(rads, rad_sh, "k:", label="Shaded");
-_ax2.legend(loc="upper left");
-_ax3.legend(loc="upper left");
-set_xlabels!(_axes, ["Total radiation (W m⁻²)" for i in 1:3]);
-set_ylabels!(_axes, ["Sunlit fraction", "PAR (μmol m⁻² s⁻¹)", "Rabs (W m⁻²)"]);
-_fig.set_tight_layout(true);
-_fig
-#------------------------------------------------------------------------------
-
-# ### vs. direct light fraction
-dirs   = collect(FT, 0.2:0.05:0.8);
-lai_sl = similar(dirs);
-par_sl = similar(dirs); par_sh = similar(dirs);
-rad_sl = similar(dirs); rad_sh = similar(dirs);
-for i in eachindex(dirs)
-    lai_sl[i], par_sl[i], par_sh[i], rad_sl[i], rad_sh[i] =
-        big_leaf_partition(FT(3), FT(30), FT(800), dirs[i]);
-end
-
-_fig,_axes = create_canvas("vs Direct light fraction"; ncol=3);
-_ax1,_ax2,_ax3 = _axes;
-_ax1.plot(dirs, lai_sl, "k-");
-_ax2.plot(dirs, par_sl, "k-", label="Sunlit");
-_ax2.plot(dirs, par_sh, "k:", label="Shaded");
-_ax3.plot(dirs, rad_sl, "k-", label="Sunlit");
-_ax3.plot(dirs, rad_sh, "k:", label="Shaded");
-_ax2.legend(loc="upper left");
-_ax3.legend(loc="upper left");
-set_xlabels!(_axes, ["Direct light fraction" for i in 1:3]);
-set_ylabels!(_axes, ["Sunlit fraction", "PAR (μmol m⁻² s⁻¹)", "Rabs (W m⁻²)"]);
-_fig.set_tight_layout(true);
-_fig
-#------------------------------------------------------------------------------
diff --git a/docs/src/examples/CanopyLayers/fluspect.jl b/docs/src/examples/CanopyLayers/fluspect.jl
deleted file mode 100644
index 148555e5..00000000
--- a/docs/src/examples/CanopyLayers/fluspect.jl
+++ /dev/null
@@ -1,69 +0,0 @@
-# # Fluspect
-
-## load packages
-using Land.CanopyLayers
-using PlotPlants
-FT = Float32;
-#------------------------------------------------------------------------------
-
-
-
-
-# ## Excitation wavelength
-wls    = create_wave_length(FT);
-can    = create_canopy_rt(FT);
-rt_dim = create_rt_dims(can, wls);
-leaf   = create_leaf_bios(FT, rt_dim);
-fluspect!(leaf, wls);
-
-_fig,_axes = create_canvas("Fluspect example"; ncol=3);
-_ax1,_ax2,_ax3 = _axes;
-_ax1.plot(wls.WL, leaf.ρ_SW, "k-", label="Reflectance");
-_ax1.plot(wls.WL, leaf.τ_SW, "k:", label="Transmittance");
-_ax2.contourf(wls.WLE, wls.WLF, leaf.Mb);
-_ax3.contourf(wls.WLE, wls.WLF, leaf.Mf);
-_ax1.legend(loc="upper right");
-_ax1.set_ylim(0,0.65);
-set_xlabels!(_axes, ["Wavelength (nm)", "Excitation wavelength (nm)",
-                     "Excitation wavelength (nm)"], fontsize=12);
-set_ylabels!(_axes, ["Reflectance or Transmittance", "SIF wavelength (nm)",
-                     "SIF wavelength (nm)"], fontsize=12);
-set_titles!(_axes; labels=["Spectrum", "Backward matrix", "Forward matrix"],
-                   usetex=false);
-_fig.set_tight_layout(true);
-_fig
-#------------------------------------------------------------------------------
-
-
-
-
-# ## Change leaf properties
-## here we change all the properties at the same time as an example
-leaf.N   = 2.0;
-leaf.Cab = 50.0;
-leaf.Car = 15.0;
-leaf.Ant = 0.1;
-leaf.Cs  = 0.1;
-leaf.Cw  = 0.02;
-leaf.Cm  = 0.02;
-leaf.Cx  = 0.1;
-leaf.fqe = 0.8;
-fluspect!(leaf, wls);
-
-_fig,_axes = create_canvas("Change leaf properties"; ncol=3);
-_ax1,_ax2,_ax3 = _axes;
-_ax1.plot(wls.WL, leaf.ρ_SW, "k-", label="Reflectance");
-_ax1.plot(wls.WL, leaf.τ_SW, "k:", label="Transmittance");
-_ax2.contourf(wls.WLE, wls.WLF, leaf.Mb);
-_ax3.contourf(wls.WLE, wls.WLF, leaf.Mf);
-_ax1.legend(loc="upper right");
-_ax1.set_ylim(0,0.65);
-set_xlabels!(_axes, ["Wavelength (nm)", "Excitation wavelength (nm)",
-                     "Excitation wavelength (nm)"], fontsize=12);
-set_ylabels!(_axes, ["Reflectance or Transmittance", "SIF wavelength (nm)",
-                     "SIF wavelength (nm)"], fontsize=12);
-set_titles!(_axes; labels=["Spectrum", "Backward matrix", "Forward matrix"],
-                   usetex=false);
-_fig.set_tight_layout(true);
-_fig
-#------------------------------------------------------------------------------
diff --git a/docs/src/examples/CanopyLayers/scope.jl b/docs/src/examples/CanopyLayers/scope.jl
deleted file mode 100644
index ef25d01a..00000000
--- a/docs/src/examples/CanopyLayers/scope.jl
+++ /dev/null
@@ -1,71 +0,0 @@
-# # SCOPE Model
-
-## load packages
-using Land.CanopyLayers
-using PlotPlants
-FT = Float32;
-#------------------------------------------------------------------------------
-
-
-
-
-# ## Initialization
-# Besides the individual functions to initialize parameters for `CanopyLayers`,
-#     a general function is provided to initialize all the parameters directly.
-angles, can, can_opt, can_rad, in_rad, leaves, rt_con, rt_dim, soil, wls =
-    initialize_rt_module(FT; nLayer=20, LAI=3);
-#------------------------------------------------------------------------------
-
-
-
-
-# ## Steps
-## 1. Update canopy optical properties (required)
-canopy_geometry!(can, angles, can_opt, rt_con);
-## 2. Update scattering coefficients (required)
-canopy_matrices!(leaves, can_opt);
-## 3. Simulate short wave simulation (required)
-short_wave!(can, can_opt, can_rad, in_rad, soil, rt_con);
-## 4. Update integrated radiation fluxes (required for photosynthesis)
-canopy_fluxes!(can, can_opt, can_rad, in_rad, soil, leaves, wls, rt_con);
-## 5. Update SIF related spectrum (required for SIF)
-SIF_fluxes!(leaves, can_opt, can_rad, can, soil, wls, rt_con, rt_dim);
-## 6. Update thermo fluxes (required for leaf energy budget)
-thermal_fluxes!(leaves, can_opt, can_rad, can, soil, [FT(400.0)], wls);
-
-_fig,_axes = create_canvas("SIF example"; ncol=2);
-_ax1,_ax2 = _axes;
-_ax1.plot(wls.WL , can_rad.alb_obs, "k-");
-_ax2.plot(wls.WLF, can_rad.SIF_obs, "k-");
-set_xlabels!(_axes, ["Wave length (nm)" for i in 1:2], fontsize=12);
-set_ylabels!(_axes, ["Albedo", "obs SIF (mW m⁻² nm⁻¹ sr⁻¹)"], fontsize=12);
-_fig.set_tight_layout(true);
-_fig
-#------------------------------------------------------------------------------
-
-
-
-
-# ## Change FQE
-for leaf in leaves
-    leaf.Cx = 0.5;
-    leaf.fqe = 0.004;
-    fluspect!(leaf, wls);
-end
-can.Ω = 0.48
-canopy_geometry!(can, angles, can_opt, rt_con);
-canopy_matrices!(leaves, can_opt);
-short_wave!(can, can_opt, can_rad, in_rad, soil, rt_con);
-canopy_fluxes!(can, can_opt, can_rad, in_rad, soil, leaves, wls, rt_con);
-SIF_fluxes!(leaves, can_opt, can_rad, can, soil, wls, rt_con, rt_dim);
-thermal_fluxes!(leaves, can_opt, can_rad, can, soil, [FT(400.0)], wls);
-
-_fig,_axes = create_canvas("SIF example FQE"; ncol=2);
-_ax1,_ax2 = _axes;
-_ax1.plot(wls.WL , can_rad.alb_obs, "k-");
-_ax2.plot(wls.WLF, can_rad.SIF_obs, "k-");
-set_xlabels!(_axes, ["Wave length (nm)" for i in 1:2], fontsize=12);
-set_ylabels!(_axes, ["Albedo", "obs SIF (mW m⁻² nm⁻¹ sr⁻¹)"], fontsize=12);
-_fig.set_tight_layout(true);
-_fig
-#------------------------------------------------------------------------------
diff --git a/docs/src/examples/Photosynthesis/parasets.jl b/docs/src/examples/Photosynthesis/parasets.jl
deleted file mode 100644
index 97047289..00000000
--- a/docs/src/examples/Photosynthesis/parasets.jl
+++ /dev/null
@@ -1,193 +0,0 @@
-# # Predefined parameter sets
-
-## load packages
-using Land.Photosynthesis
-using PlotPlants
-FT = Float32;
-#------------------------------------------------------------------------------
-
-
-
-
-# ## Jmax
-_td_1 = JmaxTDBernacchi(FT);
-_td_2 = JmaxTDCLM(FT);
-_td_3 = JmaxTDLeuning(FT);
-_ts   = collect(FT, 273:1:323);
-_jm_1 = photo_TD_from_val.([_td_1], FT(100), _ts);
-_jm_2 = photo_TD_from_val.([_td_2], FT(100), _ts);
-_jm_3 = photo_TD_from_val.([_td_3], FT(100), _ts);
-
-_fig,_axes = create_canvas("Jmax");
-_ax1 = _axes[1];
-_ax1.plot(_ts .- 273.15, _jm_1, "k-", label="Bernacchi");
-_ax1.plot(_ts .- 273.15, _jm_2, "k:", label="CLM");
-_ax1.plot(_ts .- 273.15, _jm_3, "k--", label="Leuning");
-_ax1.set_xlabel("Leaf temperature (°C)");
-_ax1.set_ylabel("Jcmax (μmol m⁻² s⁻¹)");
-_ax1.legend(loc="upper left");
-_fig
-#------------------------------------------------------------------------------
-
-
-
-
-# ## Kc
-_td_1 = KcTDBernacchi(FT);
-_td_2 = KcTDCLM(FT);
-_ts   = collect(FT, 273:1:323);
-_kc_1 = photo_TD_from_set.([_td_1], _ts);
-_kc_2 = photo_TD_from_set.([_td_2], _ts);
-
-_fig,_axes = create_canvas("Kc");
-_ax1 = _axes[1];
-_ax1.plot(_ts .- 273.15, _kc_1, "k-", label="Bernacchi");
-_ax1.plot(_ts .- 273.15, _kc_2, "k:", label="CLM");
-_ax1.set_xlabel("Leaf temperature (°C)");
-_ax1.set_ylabel("Kc (Pa)");
-_ax1.legend(loc="upper left");
-_fig
-#------------------------------------------------------------------------------
-
-
-
-
-# ## Ko
-_td_1 = KoTDBernacchi(FT);
-_td_2 = KoTDCLM(FT);
-_ts   = collect(FT, 273:1:323);
-_ko_1 = photo_TD_from_set.([_td_1], _ts);
-_ko_2 = photo_TD_from_set.([_td_2], _ts);
-
-_fig,_axes = create_canvas("Ko");
-_ax1 = _axes[1];
-_ax1.plot(_ts .- 273.15, _ko_1, "k-", label="Bernacchi");
-_ax1.plot(_ts .- 273.15, _ko_2, "k:", label="CLM");
-_ax1.set_xlabel("Leaf temperature (°C)");
-_ax1.set_ylabel("Ko (Pa)");
-_ax1.legend(loc="upper left");
-_fig
-#------------------------------------------------------------------------------
-
-
-
-
-# ## Kpep
-_td_1 = KpepTDBoyd(FT);
-_td_2 = KpepTDCLM(FT);
-_ts   = collect(FT, 273:1:323);
-_kp_1 = photo_TD_from_set.([_td_1], _ts);
-_kp_2 = photo_TD_from_set.([_td_2], _ts);
-
-_fig,_axes = create_canvas("Kpep");
-_ax1 = _axes[1];
-_ax1.plot(_ts .- 273.15, _kp_1, "k-", label="Boyd");
-_ax1.plot(_ts .- 273.15, _kp_2, "k:", label="CLM");
-_ax1.set_xlabel("Leaf temperature (°C)");
-_ax1.set_ylabel("Kpep (Pa)");
-_ax1.legend(loc="upper left");
-_fig
-#------------------------------------------------------------------------------
-
-
-
-
-# ## Respiration
-_td_1 = RespirationTDBernacchi(FT);
-_td_2 = RespirationTDCLM(FT);
-_td_3 = Q10TDAngiosperm(FT);
-_td_4 = Q10TDGymnosperm(FT);
-_ts   = collect(FT, 273:1:323);
-_rd_1 = photo_TD_from_val.([_td_1], FT(1), _ts);
-_rd_2 = photo_TD_from_val.([_td_2], FT(1), _ts);
-_rd_3 = photo_TD_from_val.([_td_3], FT(1), _ts);
-_rd_4 = photo_TD_from_val.([_td_4], FT(1), _ts);
-
-_fig,_axes = create_canvas("Respiration");
-_ax1 = _axes[1];
-_ax1.plot(_ts .- 273.15, _rd_1, "k-", label="Bernacchi");
-_ax1.plot(_ts .- 273.15, _rd_2, "k:", label="CLM");
-_ax1.plot(_ts .- 273.15, _rd_3, "r-", label="Q10 Angiosperm");
-_ax1.plot(_ts .- 273.15, _rd_4, "r:", label="Q10 Gymnosperm");
-_ax1.set_xlabel("Leaf temperature (°C)");
-_ax1.set_ylabel("Respiration (μmol m⁻² s⁻¹)");
-_ax1.legend(loc="upper left");
-_fig
-#------------------------------------------------------------------------------
-
-
-
-
-# ## Vcmax
-_td_1 = VcmaxTDBernacchi(FT);
-_td_2 = VcmaxTDCLM(FT);
-_td_3 = VcmaxTDLeuning(FT);
-_ts   = collect(FT, 273:1:323);
-_vc_1 = photo_TD_from_val.([_td_1], FT(100), _ts);
-_vc_2 = photo_TD_from_val.([_td_2], FT(100), _ts);
-_vc_3 = photo_TD_from_val.([_td_3], FT(100), _ts);
-
-_fig,_axes = create_canvas("Vcmax");
-_ax1 = _axes[1];
-_ax1.plot(_ts .- 273.15, _vc_1, "k-", label="Bernacchi");
-_ax1.plot(_ts .- 273.15, _vc_2, "k:", label="CLM");
-_ax1.plot(_ts .- 273.15, _vc_3, "k--", label="Leuning");
-_ax1.set_xlabel("Leaf temperature (°C)");
-_ax1.set_ylabel("Vcmax (μmol m⁻² s⁻¹)");
-_ax1.legend(loc="upper left");
-_fig
-#------------------------------------------------------------------------------
-
-
-
-
-# ## Vomax
-_td_1 = VomaxTDBernacchi(FT);
-_ts   = collect(FT, 273:1:323);
-_vo_1 = photo_TD_from_val.([_td_1], FT(100), _ts);
-
-_fig,_axes = create_canvas("Vomax");
-_ax1 = _axes[1];
-_ax1.plot(_ts .- 273.15, _vo_1, "k-", label="Bernacchi");
-_ax1.set_xlabel("Leaf temperature (°C)");
-_ax1.set_ylabel("Vomax (μmol m⁻² s⁻¹)");
-_ax1.legend(loc="upper left");
-_fig
-#------------------------------------------------------------------------------
-
-
-
-
-# ## Vpmax
-_td_1 = VpmaxTDBoyd(FT);
-_ts   = collect(FT, 273:1:323);
-_vp_1 = photo_TD_from_val.([_td_1], FT(100), _ts);
-
-_fig,_axes = create_canvas("Vpmax");
-_ax1 = _axes[1];
-_ax1.plot(_ts .- 273.15, _vp_1, "k-", label="Boyd");
-_ax1.set_xlabel("Leaf temperature (°C)");
-_ax1.set_ylabel("Vpmax (μmol m⁻² s⁻¹)");
-_ax1.legend(loc="upper left");
-_fig
-#------------------------------------------------------------------------------
-
-
-
-
-# ## Γ*
-_td_1 = ΓStarTDBernacchi(FT);
-_td_2 = ΓStarTDCLM(FT);
-_ts   = collect(FT, 273:1:323);
-_Γs_1 = photo_TD_from_set.([_td_1], _ts);
-_Γs_2 = photo_TD_from_set.([_td_2], _ts);
-
-_fig,_axes = create_canvas("Γ*");
-_ax1 = _axes[1];
-_ax1.plot(_ts .- 273.15, _Γs_1, "k-", label="Bernacchi");
-_ax1.plot(_ts .- 273.15, _Γs_2, "k:", label="CLM");
-_ax1.set_xlabel("Leaf temperature (°C)");
-_ax1.set_ylabel("Γ* (Pa)");
-_ax1.legend(loc="upper left");
-_fig
-#------------------------------------------------------------------------------
diff --git a/docs/src/examples/Photosynthesis/photosynthesis.jl b/docs/src/examples/Photosynthesis/photosynthesis.jl
deleted file mode 100644
index d790142c..00000000
--- a/docs/src/examples/Photosynthesis/photosynthesis.jl
+++ /dev/null
@@ -1,75 +0,0 @@
-# # Temperature dependencies
-
-## load packages
-using Land.Photosynthesis
-using PlotPlants
-FT = Float32;
-#------------------------------------------------------------------------------
-
-
-
-
-# ## Simple example
-## define photosynthesis system and leaf (C3 and C4), and envir
-c3_set = C3CLM(FT);
-c4_set = C4CLM(FT);
-leaf_3 = Leaf{FT}(APAR=1000);
-leaf_4 = Leaf{FT}(APAR=1000);
-envir  = AirLayer{FT}();
-
-## define leaf temperature, total leaf conductance to CO₂, and internal CO₂
-T   = FT(300);
-glc = FT(0.1);
-p_i = rand(FT) + 20;
-
-## remember to update the temperature dependencies when temperature changes
-println("initialize temperature dependencies");
-leaf_temperature_dependence!(c3_set, leaf_3, envir, T);
-leaf_temperature_dependence!(c4_set, leaf_4, envir, T);
-
-println("calculate photosynthesis from known internal CO₂ partial pressure");
-leaf_photosynthesis!(c3_set, leaf_3, envir, PCO₂Mode(), p_i);
-leaf_photosynthesis!(c4_set, leaf_4, envir, PCO₂Mode(), p_i);
-@show leaf_3.An;
-@show leaf_4.An;
-
-println("calculate photosynthesis from known leaf conductance to CO₂");
-leaf_photosynthesis!(c3_set, leaf_3, envir, GCO₂Mode(), glc);
-leaf_photosynthesis!(c4_set, leaf_4, envir, GCO₂Mode(), glc);
-@show leaf_3.An;
-@show leaf_4.An;
-#------------------------------------------------------------------------------
-
-
-
-
-# ## A-Ci curve
-# Here we show an example of the A-Ci curves for C3 and C4 photosynthesis. As
-#     stomatal conductance may differ when other environmental conditions
-#     change, we leave the examples of photosynthesis responses to the
-#     environment for `StomataModels` package.
-## temperature not changing, no temperature dependencies update required
-_p3 = collect(FT, 5:1:200);
-_p4 = collect(FT, 0:0.1:15.01);
-_a3 = similar(_p3);
-_a4 = similar(_p4);
-for i in eachindex(_p3)
-    leaf_photosynthesis!(c3_set, leaf_3, envir, PCO₂Mode(), _p3[i]);
-    _a3[i] = leaf_3.An;
-end
-for i in eachindex(_p4)
-    leaf_photosynthesis!(c4_set, leaf_4, envir, PCO₂Mode(), _p4[i]);
-    _a4[i] = leaf_4.An;
-end
-
-_fig,_axes = create_canvas("A-Ci curve"; ncol=2);
-_ax1,_ax2 = _axes;
-_ax1.plot(_p3, _a3, "k-", label="C3");
-_ax2.plot(_p4, _a4, "k-", label="C4");
-_ax1.set_xlabel("Leaf internal CO₂ (Pa)");
-_ax1.set_ylabel("Anet (μmol m⁻² s⁻¹)");
-_ax2.set_xlabel("Leaf internal CO₂ (Pa)");
-_ax1.legend(loc="lower right");
-_ax2.legend(loc="lower right");
-_fig
-#------------------------------------------------------------------------------
diff --git a/docs/src/examples/Photosynthesis/temperature.jl b/docs/src/examples/Photosynthesis/temperature.jl
deleted file mode 100644
index 0f6d3d52..00000000
--- a/docs/src/examples/Photosynthesis/temperature.jl
+++ /dev/null
@@ -1,55 +0,0 @@
-# # Temperature dependencies
-
-## load packages
-using Land.Photosynthesis
-using PlotPlants
-FT = Float32;
-#------------------------------------------------------------------------------
-
-
-
-
-# ## Arrhenius correction
-# ### Without deactivation term
-## KcTDCLM is a ArrheniusTD type struct, use it as an example here
-_td = KcTDCLM(FT);
-_ts = collect(FT, 273:1:323);
-_ks = temperature_correction.([_td], _ts);
-
-_fig,_axes = create_canvas("Arrhenius correction without deactivation");
-_ax1 = _axes[1];
-_ax1.plot(_ts .- 273.15, _ks, "k-");
-_ax1.set_xlabel("Leaf temperature (°C)");
-_ax1.set_ylabel("Relative to 25 °C");
-_fig
-#------------------------------------------------------------------------------
-
-# ### With deactivation term
-## VcmaxTDCLM is a ArrheniusPeakTD type struct, use it as an example here
-_td = VcmaxTDCLM(FT);
-_ts = collect(FT, 273:1:323);
-_ks = temperature_correction.([_td], _ts);
-
-_fig,_axes = create_canvas("Arrhenius correction with deactivation");
-_ax1 = _axes[1];
-_ax1.plot(_ts .- 273.15, _ks, "k-");
-_ax1.set_xlabel("Leaf temperature (°C)");
-_ax1.set_ylabel("Relative to 25 °C");
-_fig
-#------------------------------------------------------------------------------
-
-
-
-
-# ## Q10 correction
-_td = Q10TD{FT}(1.0, 273.15, 1.7);
-_ts = collect(FT, 273:1:323);
-_ks = temperature_correction.([_td], _ts);
-
-_fig,_axes = create_canvas("Q10 correction");
-_ax1 = _axes[1];
-_ax1.plot(_ts .- 273.15, _ks, "k-");
-_ax1.set_xlabel("Leaf temperature (°C)");
-_ax1.set_ylabel("Relative to 25 °C");
-_fig
-#------------------------------------------------------------------------------
diff --git a/docs/src/index.md b/docs/src/index.md
index 12ba9943..3e6a5fd4 100644
--- a/docs/src/index.md
+++ b/docs/src/index.md
@@ -1,9 +1,9 @@
-# CliMA Land Model
+# CliMA Land Model v0.1
 
-## Install CliMA Land Model
+## Install CliMA Land Model v0.1
 
 ```
 julia> using Pkg
-julia> Pkg.add(PackageSpec(url="https://github.com/CliMA/Land.git"))
+julia> Pkg.add(PackageSpec(url="https://github.com/silicormosia/clima-land-v0.1.git"))
 julia> using Land
 ```
diff --git a/docs/src/submodules/CanopyLayers.md b/docs/src/submodules/CanopyLayers.md
index cc51f0ae..25d8b0d2 100644
--- a/docs/src/submodules/CanopyLayers.md
+++ b/docs/src/submodules/CanopyLayers.md
@@ -26,42 +26,21 @@ WaveLengths
 ## Caches
 ```@docs
 CFCache
-create_cf_cache
 CGCache
-create_cg_cache
 SFCache
-create_sf_cache
 SWCache
-create_sw_cache
 RTCache
-create_rt_cache
 ```
 
 
 ## Initialization of Structures
 ```@docs
-create_canopy_opticals
-create_canopy_rads
-create_canopy_rt
-create_incoming_radiation
-create_leaf_bios
-create_leaf_opticals
-create_rt_dims
-create_wave_length
 initialize_rt_module
 ```
 
 
 
 
-## Big Leaf Model
-```@docs
-big_leaf_partition
-```
-
-
-
-
 ## SCOPE Model
 ```@docs
 canopy_fluxes!
diff --git a/docs/src/submodules/Photosynthesis.md b/docs/src/submodules/Photosynthesis.md
index b39c66e7..dc642a82 100644
--- a/docs/src/submodules/Photosynthesis.md
+++ b/docs/src/submodules/Photosynthesis.md
@@ -312,3 +312,11 @@ The function that is used to compute fluorescene is
 ```@docs
 leaf_fluorescence!
 ```
+
+
+
+
+## Misc
+```@docs
+C3Cytochrome
+```
diff --git a/docs/src/submodules/SoilPlantAirContinuum.md b/docs/src/submodules/SoilPlantAirContinuum.md
index f3ff0a6f..39a28357 100644
--- a/docs/src/submodules/SoilPlantAirContinuum.md
+++ b/docs/src/submodules/SoilPlantAirContinuum.md
@@ -5,18 +5,7 @@ CurrentModule = Land.SoilPlantAirContinuum
 
 ## Types
 ```@docs
-SPACContainer1L
-SPACContainer2L
 SPACMono
-SPACSimple
-```
-
-## Soil
-```@docs
-soil_moisture_swc!
-soil_moisture_p!
-soil_moisture_p25!
-soil_moisture!
 ```
 
 ## Planet
@@ -26,29 +15,3 @@ atmospheric_pressure
 ppm_to_Pa
 zenith_angle
 ```
-
-## Big-leaf model
-```@docs
-gain_risk_map
-leaf_gas_exchange_nonopt!
-leaf_gas_exchange!
-optimize_flows!
-big_leaf_partition!
-radiative_conductance
-black_body_emittance
-boundary_layer_conductance
-leaf_temperature
-leaf_temperature_sunlit
-leaf_temperature_shaded
-annual_profit
-annual_simulation!
-create_dataframe
-initialize_spac_canopy!
-```
-
-## Optimal investment
-```@docs
-leaf_allocation!
-optimize_leaf!
-optimize_hs!
-```
diff --git a/docs/src/tips.md b/docs/src/tips.md
index 814f8a82..c23ace8b 100644
--- a/docs/src/tips.md
+++ b/docs/src/tips.md
@@ -1,4 +1,4 @@
-# Git and Julia Tips for CliMA.Land
+# Git and Julia Tips for CliMA Land v0.1
 
 ## Instantiate the project
 1. The Land project
diff --git a/docs/src/tutorial_scripts/GSV_soil_model.jl b/docs/src/tutorial_scripts/GSV_soil_model.jl
deleted file mode 100644
index d2b2118e..00000000
--- a/docs/src/tutorial_scripts/GSV_soil_model.jl
+++ /dev/null
@@ -1,93 +0,0 @@
-# # # GSV: a general model for hyperspectral soil reflectance simulation
-# 
-# Soil reflectance is crucial for canopy radiative transfer modeling. Spectral vector models are more flexible than typical soil albedo models, because they can ingest observed data and significantly improves hyperspectral soil reflectance modeling in terms of accuracy and robustness. 
-# 
-# We demonstrate the usage of the general spectral vectors (GSV) model[^1] developed to employ three dry spectral vectors and one humid spectral vector derived from global dry and humid soil reflectance databases including 23,871 soil spectra (400–2500 nm). The GSV model accurately simulates global soil reflectance with an R2 of 0.99 and RMSE of 0.01. The GSV model is highly suitable to be coupled with the CliMA model for vegetation remote sensing studies. 
-# 
-#  [^1]: Jiang, C., & Fang, H. (2019). GSV: a general model for hyperspectral soil reflectance simulation. International Journal of Applied Earth Observation and Geoinformation, 83(July), 101932. https://doi.org/10.1016/j.jag.2019.101932
-# 
-
-# # Load used packages
-
-#### Use Julia Plots package and switch to plotly js option:
-using Plots
-using StatsPlots
-pyplot()
-
-##----------------------------------------------------------------------------
-
-## First, we include Revise (good for debugging) and Parameters (tools for structures)
-
-##using Revise
-using Parameters
-using Statistics
-using CSV
-using DataStructures
-
-##----------------------------------------------------------------------------
-using LinearAlgebra
-#----------------------------------------------------------------------------
-
-# # Define used variables
-
-## The hyperspectral wavelengths
-WVL = 400:10:2501
-## The general spectral vectors derived in the manuscript
-GSV = [CSV.read("DryVec.csv"; header=false);CSV.read("SMVec.csv"; header=false)]
-## The test hyperspectral data
-hyper = CSV.read("TestSpectrum_v1.csv";header=false)
-## The wavelengths of multispectral data
-wvl = [450,550,650,850,1650,2150]
-## The test multispectral data sliced from hyperspectral data
-indices = []
-
-for i in wvl
-    push!(indices, findall(x -> x==i, WVL)[1])
-end 
-
-multi = hyper[:,indices]
-
-
-## Step 1: slice GSV according to the wavelengths of multispectral data
-gsv = GSV[:,indices]
-#----------------------------------------------------------------------------
-
-# # Define plot
-
-## Step 2: fit multispectral soil reflectance and reconstruct multispectral soil reflectance
-X=convert(Matrix,multi)
-V=convert(Matrix,gsv)
-C = X * LinearAlgebra.pinv(V)
-R = C * V
-R[R.<0] .= 0
-R[R.>1] .= 1
-#----------------------------------------------------------------------------
-
-scatter(X,R,label="")
-plot!([0,0.4],[0,0.4],label="")
-ylabel!("Simulations")
-xlabel!("Measurements")
-#----------------------------------------------------------------------------
-
-## Step 3: reconstruct hyperspectral soil reflectance using coefficients fitted from multispectral data
-X = convert(Matrix,hyper)
-V = convert(Matrix,GSV)
-R = C * V
-R[R.<0] .= 0
-R[R.>1] .= 1
-#----------------------------------------------------------------------------
-
-scatter(X,R,label="")
-plot!([0,0.4],[0,0.4],label="")
-ylabel!("Simulations")
-xlabel!("Measurements")
-#----------------------------------------------------------------------------
-
-## Compare measured multispectral data and hyperspectral data with reconstructed ones
-plot(WVL,transpose(convert(Matrix,hyper)),label="Actual hyperspectral reflectance")
-scatter!(wvl,transpose(Matrix(multi)),label="Observed multispectral reflectance")
-plot!(WVL,transpose(R),label="Simulated hyperspectral reflectance\nfitted from multispectral reflectance")
-ylabel!("Soil albedo")
-xlabel!("wl (nm)")
-
-#----------------------------------------------------------------------------
diff --git a/docs/src/tutorial_scripts/Leaf-Photosynthesis-Rates.jl b/docs/src/tutorial_scripts/Leaf-Photosynthesis-Rates.jl
deleted file mode 100644
index 43d991a5..00000000
--- a/docs/src/tutorial_scripts/Leaf-Photosynthesis-Rates.jl
+++ /dev/null
@@ -1,113 +0,0 @@
-
-# # Rate Constants, T-dependence
-# Here, we will just briefly summarize how temperature affects enzymatic rate constants and how much uncertainty there actually is in literature (in terms of how to best define them and how plastic some of the variables are)
-
-## Add usual tools we use:
-#using Revise
-using BenchmarkTools
-
-# Use PyPlot to plot figures
-using PyPlot
-
-#----------------------------------------------------------------------------
-
-## load Photosynthesis module: 
-using Land.Photosynthesis
-#----------------------------------------------------------------------------
-
-## Specify Field Type
-const FT = Float32
-#----------------------------------------------------------------------------
-
-# ## T-dependence of V$_{c,max}$
-# In literature, there are different implementations of the temperature dependence of enzymatic reaction rates. Common among all of them is a typical Arrhenius formulation with Activation energy $E_a$, which leads to a temperature dependence of a quantity $V$ given the standard value defined at 25°C as $T_{ref}$.
-# 
-# $$V(T)= V(T_{ref})\, \underbrace{\exp\left(\frac{E_a}{RT_{ref}}-\frac{E_a}{RT}\right)}_{\text{Activation}}$$
-# 
-# Other formulations add de-activation of proteins due to denaturalization at higher temperatures:
-# $$V(T)= V(T_{ref})\, \exp\left(\frac{E_a}{RT_{ref}}-\frac{E_a}{RT}\right) \underbrace{\frac{1+\exp\left((\Delta ST_{ref}-H_d)/RT_{ref}\right)}{1+\exp\left((\Delta ST-H_d)/RT\right)}}_{\text{de-activation}} $$
-# which includes an entropy term $\Delta S$ and the energy for deactivation $H_d$.
-# 
-# To illustrate the differences, we show two different implementations, one only using the activation part based on Bernacchi et al 2001[^1] and one with the typical CLM5 implementation.
-# 
-# [^1]: Bernacchi, C.J., Singsaas, E.L., Pimentel, C., Portis Jr, A.R. and Long, S.P., 2001. Improved temperature response functions for models of Rubisco‐limited photosynthesis. Plant, Cell & Environment, 24(2), pp.253-259.
-# 
-
-## This looks a bit more tedious here than it needs to but in reality
-
-vcmax_Bernacchi = Float32[]
-vcmax_CLM = Float32[]
-
-## Define T-range
-Tleaf = collect(FT,260.0:1.0:315.0)
-
-## Run through temperatures and save Vcmax values:
-td_vc_bernacchi = Photosynthesis.VcmaxTDBernacchi(FT)
-td_vc_clm       = Photosynthesis.VcmaxTDCLM(FT)
-for T in Tleaf
-    _Vcmax = Photosynthesis.photo_TD_from_val(td_vc_bernacchi, FT(100.0), T)
-    push!(vcmax_Bernacchi, _Vcmax)
-    _Vcmax = Photosynthesis.photo_TD_from_val(td_vc_clm, FT(100.0), T)
-    push!(vcmax_CLM, _Vcmax)
-end
-#----------------------------------------------------------------------------
-
-figure()
-plot(Tleaf .- 273.15, vcmax_Bernacchi, label="Bernacchi", lw=2)
-plot(Tleaf .- 273.15, vcmax_CLM,  label="CLM5", lw=2)
-ylabel("Vcmax (µmol/m²/s)")
-xlabel("Leaf Temperature (°C)")
-legend()
-gcf()
-#----------------------------------------------------------------------------
-
-# ### CO$_2$ compensation point $\Gamma_\star$
-
-## Here, we only have one implementation:
-Γ_CLM = Float32[]
-Tleaf = collect(FT,260.0:1.0:315.0)
-td_gamma_clm = Photosynthesis.ΓStarTDCLM(FT)
-
-for T in Tleaf
-    _ΓStar = Photosynthesis.photo_TD_from_set(td_gamma_clm, T)
-    push!(Γ_CLM, _ΓStar)
-end
-#----------------------------------------------------------------------------
-figure()
-plot(Tleaf .- 273.15, Γ_CLM, label="Γ_CLM")
-ylabel("Γ⋆ (Pa)")
-xlabel("Leaf Temperature (°C)")
-legend()
-gcf()
-#----------------------------------------------------------------------------
-
-# ## T-dependence of J$_{max}$
-
-Jmax_Bernacchi = Float32[]
-Jmax_CLM = Float32[]
-Tleaf = collect(FT,260.0:1.0:315.0)
-
-td_j_bernacchi = Photosynthesis.JmaxTDBernacchi(FT)
-td_j_clm = Photosynthesis.JmaxTDCLM(FT)
-
-for T in Tleaf
-    _Jmax = Photosynthesis.photo_TD_from_val(td_j_bernacchi, FT(100.0), T)
-    push!(Jmax_Bernacchi, _Jmax)
-    _Jmax = Photosynthesis.photo_TD_from_val(td_j_clm, FT(100.0), T)
-    push!(Jmax_CLM, _Jmax)
-end
-#----------------------------------------------------------------------------
-figure()
-plot(Tleaf .- 273.15, Jmax_Bernacchi, label="Bernacchi")
-plot(Tleaf .- 273.15, Jmax_CLM,  label="CLM5")
-ylabel("Jmax (µmol/m2/s)")
-xlabel("Leaf Temperature (°C)")
-legend()
-gcf()
-#----------------------------------------------------------------------------
-
-# --- 
-# ## Summary 
-# The way land surface models implement temperature variations in V$_{c,max}$ is still rather variable and there is no clear consensus in what model is best. In addition, gas exchange datasets performed at different temperatures might actually alias different confounding factors into the V$_{c,max}$ determination, so that the actually fitted V$_{c,max}$ strongly depends on the model formulation. E.g. mesophyll conductance is usually ignore in deriving V$_{c,max}$ but might be temperature dependent, which can cause T-dependent errors in V$_{c,max}$.
-# 
-# That said, having the option to use different model forumations and actually using the ones that are implemented in land surface models directly when fitting leaf level measurements seems to be a prudent way to improve models in the future. More leaf level data might help in the future, especially looking at temperature dependencies, mesophyll conductance, and fluorescence yields. So many chemical and phsyical aspects change with temperature that it is hard to isolate impacting factors. Now, at least, we can run the models directly in the REPL, which is great for prototyping anc validating the model on the individual module level without any effort in terms of additional coding. 
diff --git a/docs/src/tutorial_scripts/Leaf-Photosynthesis-Synthesis.jl b/docs/src/tutorial_scripts/Leaf-Photosynthesis-Synthesis.jl
deleted file mode 100644
index b7e8aa47..00000000
--- a/docs/src/tutorial_scripts/Leaf-Photosynthesis-Synthesis.jl
+++ /dev/null
@@ -1,336 +0,0 @@
-
-# # Leaf Level Photosynthesis 
-# 
-# Here, we will go one step further and look at the entire leaf-level response, including the impact of stomatal conductance as well. 
-
-# ## Stomatal Conductance
-# Before, we focussed mainly on the demand-driven constraints through Rubisco and RuBP regeneration. Stomatal conductance is highly important as it drives the suppy-side of photosynthesis and interacts with the energy balance and leaf temperature as latent heat fluxes are a major factor in surface cooling. 
-# 
-# Before, we have derived net rates of photosynthesis $A_n$, which have to be matched with the supply side through CO$_2$ diffusion:
-# 
-# $$A_n^{diff} = g_{leaf,C}(C_a-C_c)$$
-# 
-# which can be separated into diffusion from the air to the leaf surface with a boundary layer conductance $g_{b,C}$, diffusion from the surface to the interstitial air-space with stomatal conductance $g_{s,C}$ and diffusion from the  interstitial air-space to the chloroplast with mesophyll conductance $g_{m,C}$ (the letter C stands for CO2 here, as the diffusion constants vary with species, e.g. H$_2$O stomatal conductance is a factor 1.6 higher than those for CO$_2$):
-# 
-# $$A_n^{diff} = g_{b,C}(C_a-C_s) = g_{s,C}(C_s-C_i) = g_{m,C}(C_i-C_c) = g_{leaf,C}(C_a-C_c)$$
-# 
-# $$g_{leaf,C} = \left(\frac{1}{g_{b,C}+g_{s,C}+g_{m,C}}\right)^{-1}$$
-# 
-# The importance of stomatal conductance and its interplay with photosynthesis here is that the supply and demand rates determine $C_c$. A reduction in $C_c$ reduces the demand-limited rates while it increase the diffusion rates (at a given $g$). Most models run internal so-called A-$C_c$ iterations to ensure both rates are balanced and in steady-state ($\partial C_c/\partial t=0$). We implement this option but also opt to run stomatal conductance prognostically, as stomata don't open and close instantanously but have a response time of around 15 minutes.  
-# 
-# ### Empirical Stomatal Conductance models
-# 
-# Currently, we can choose between the widely used Ball-Berry model[^1] or the Medlyn approach[^2]. 
-# 
-# Ball and Berry derived the following empirical formulation based on leaf level data (RH is relative humidity):
-# 
-# $$g_{s,w} = g_0 + g_1  \frac{A_n \cdot RH}{C_s}$$
-# 
-# Medlyn derived the following equations based on stomatal optimization theory but in a similar form as the BB model:
-# 
-# $$g_{s,w} = g_0 + \left(1 + \frac{g_1}{\sqrt{VPD}}\right) \frac{A_n}{C_s}$$
-# 
-# Both models are proportional to $A_n$ and inversely proportional to $C_s$, with the main difference in the dependence on either relative humidity in the Ball-Berry model vs. vapor pressure deficit (VPD) in Medlyn et al. In both cases, $g_0$ is the residual conductivity even if stomata are fully closed and $g_1$ is related to the marginal water cost of plant carbon gain. Importantly, $g_1$ can't be inter-changed between the formulations, underlining again that parameters have to be optimized with respect to the model that is eventually being used. 
-# 
-# ### Stomatal Optimization Theories
-# 
-# The empirical formulations only hold in well-watered soil and our main goal is to implement stomatal optimization models to take the entire soil-plant-atmosphere continuum into account[^3]. Here, we will just use the empirical models and steady-state photosynthesis to show the underlying principles.
-# 
-# [^1]: Ball, J.T., Woodrow, I.E. and Berry, J.A., 1987. A model predicting stomatal conductance and its contribution to the control of photosynthesis under different environmental conditions. In Progress in photosynthesis research (pp. 221-224). Springer, Dordrecht.
-# 
-# [^2]: Medlyn, B.E., Duursma, R.A., Eamus, D., Ellsworth, D.S., Prentice, I.C., Barton, C.V., Crous, K.Y., De Angelis, P., Freeman, M. and Wingate, L., 2011. Reconciling the optimal and empirical approaches to modelling stomatal conductance. Global Change Biology, 17(6), pp.2134-2144.
-# 
-# [^3]: Wang, Y., Sperry, J.S., Anderegg, W.R., Venturas, M.D. and Trugman, A.T., 2020. A theoretical and empirical assessment of stomatal optimization modeling. New Phytologist.
-# 
-
-
-
-
-
-
-
-
-## Add usual tools we use:
-##using Revise
-using BenchmarkTools
-using PyPlot
-#----------------------------------------------------------------------------
-
-## load Photosynthesis module: 
-using Land.Photosynthesis
-#----------------------------------------------------------------------------
-
-## Specify Field Type
-const FT = Float64
-#----------------------------------------------------------------------------
-
-## Create a standard leaf with defualt parameters
-leaf3 = Leaf{FT}(APAR=1200, Vcmax25=90, Jmax25=90*1.9, Vpmax25=100, Rd25=1);
-leaf4 = Leaf{FT}(APAR=1200, Vcmax25=90, Jmax25=90*1.9, Vpmax25=100, Rd25=1);
-## Create a standard meteo structure:
-envir  = AirLayer{FT}();
-#----------------------------------------------------------------------------
-
-## Setting some standard values (dynamic-state=false forces A-Cc iterations)
-##leaf.dynamic_state = false
-#----------------------------------------------------------------------------
-
-# --- 
-# ## Modular stucture: 
-# The most important step is to define which submodules to use. There might be different implementations for Fluorescence, Photosynthesis (C3,C4,etc), respiration, stomatal conductance (e.g. Ball-Berry, Medlyn), the T-dependence of J$_{max}$, V$_{c,max}$ and Michaelis Menten constants as well as leaf boundary layer resistance (setting it to 0 here to mimic well vented laboratory leaf level measurements) and colimitation. 
-# 
-# Below, we create two different model setups with a C3 and C4 photosynthesis pathway. Note that we chose the Ball Berry stomatal conductance model with different $g_1$ for C3 and C4 (C4 typically much lower).
-
-## use this as the boundary layer resistance (1/gb)
-## deprecated as there are g_bw and g_bc terms in Leaf struct
-## ra = FT(0.5)
-
-## C3 Photosynthesis
-# Use pre-defined parameter sets
-modC3 = C3CLM(FT)
-#modC3.Sto = Photosynthesis.OSMWang()
-modC3.Sto = Photosynthesis.ESMBallBerry{FT}(g1 = 16)
-
-## C4 Photosynthesis
-modC4 = C4CLM(FT)
-#modC4.Sto = Photosynthesis.OSMWang()
-modC4.Sto = Photosynthesis.ESMBallBerry{FT}(g1 = 8)
-#----------------------------------------------------------------------------
-
-# ## Light response curves
-# Now we can compute light response curves for C3 and C4 photosynthesis
-
-##Again, this looks tedious and repetitive but is the easiest way to do this right now:
-
-## Variable I want to save:
-Ag_C3 = Float32[]; Ag_C4 = Float32[]
-An_C3 = Float32[]; An_C4 = Float32[]
-Aj_C3 = Float32[]; Aj_C4 = Float32[]
-Ap_C3 = Float32[]; Ap_C4 = Float32[]
-Ac_C3 = Float32[]; Ac_C4 = Float32[]
-Cc_C3 = Float32[]; Cc_C4 = Float32[]
-gs_C3 = Float32[]; gs_C4 = Float32[]
-
-APAR = collect(FT, 0:10:1700)
-for _APAR in APAR
-    leaf3.APAR = _APAR;
-    leaf4.APAR = _APAR;
-    ## Run C3 photosynthesis (general photosynthesis model):
-    leaf_photo_from_envir!(modC3, leaf3, envir, modC3.Sto);
-    ## Save leaf variables:
-    push!(An_C3, leaf3.An); push!(Ag_C3, leaf3.Ag);
-    push!(Aj_C3, leaf3.Aj); push!(Ap_C3, leaf3.Ap);
-    push!(Ac_C3, leaf3.Ac); push!(Cc_C3, leaf3.p_i);
-    push!(gs_C3, leaf3.g_sw);
-    
-    ## Run C4 photosynthesis:
-    leaf_photo_from_envir!(modC4, leaf4, envir, modC4.Sto);
-    ## Save leaf variables:
-    push!(An_C4, leaf4.An); push!(Ag_C4, leaf4.Ag);
-    push!(Aj_C4, leaf4.Aj); push!(Ap_C4, leaf4.Ap);
-    push!(Ac_C4, leaf4.Ac); push!(Cc_C4, leaf4.p_i);
-    push!(gs_C4, leaf4.g_sw);
-end
-#----------------------------------------------------------------------------
-
-## Testing some times, how long does this take (as we need to run it globally, it has to be efficient)?
-## Slow for now, because of unnecessary allocations
-## Will improve when the structs are cleaned up
-#@btime leaf_photo_from_envir!(modC3, leaf3, envir, modC3.Sto);
-#@btime leaf_photo_from_envir!(modC4, leaf4, envir, modC4.Sto);
-#----------------------------------------------------------------------------
-
-# ## C3 Light Response Curve
-
-##plot(APAR, An,  label="An")
-figure()
-plot(APAR, Ag_C3,color=:black,lw=2, alpha=0.7, label="Ag C3")
-plot(APAR, Ac_C3, ls="--", lw=2, label="Ac C3")
-plot(APAR, Aj_C3, ls="--", lw=2, label="Aj C3")
-plot(APAR, Ap_C3, ls="--", lw=2, label="Ap C3" )
-xlabel("APAR [μmol/m2/s]")
-ylabel("Aᵢ [μmol/m2/s]")
-title("C3 photosynthesis light response")
-legend()
-gcf()
-#----------------------------------------------------------------------------
-
-# ## C4 Light Response Curve
-
-##plot(APAR, An,  label="An")
-figure()
-plot(APAR, Ag_C4,color=:black, lw=2, alpha=0.7, label="Ag C4")
-plot(APAR, Ac_C4, ls="--", lw=2, label="Ac C4")
-plot(APAR, Aj_C4, ls="--", lw=2, label="Aj C4")
-plot(APAR, Ap_C4, ls="--", lw=2, label="Ap C4" )
-xlabel("APAR [μmol/m2/s]")
-ylabel("Aᵢ [μmol/m2/s]")
-title("C4 photosynthesis light response")
-legend()
-gcf()
-#----------------------------------------------------------------------------
-
-# ### Dependence of $C_c$ on light
-# Increasing light should result in overall lower $C_c$ concentrations. C4 plants can work with much lower $C_c$ as for C4, the concentration in the bundle sheath cells count, not the mesophyll. 
-
-figure()
-plot(APAR, Cc_C4/envir.p_a,color=:black ,lw=2, alpha=0.7, label="Cc/Ca C4")
-plot(APAR, Cc_C3/envir.p_a,color=:orange,lw=2, alpha=0.7, label="Cc/Ca C3")
-xlabel("APAR [μmol/m²/s]")
-ylabel("Cc/Ca [-]")
-legend()
-gcf()
-#----------------------------------------------------------------------------
-
-# ### Dependence of stomatal coductance g$_s$
-
-#This part has been broken by Yuije, please fix it
-figure()
-plot(APAR, gs_C4,color=:black ,lw=2, alpha=0.7, label="gs C4")
-plot(APAR, gs_C3,color=:orange,lw=2, alpha=0.7, label="gs C3")
-xlabel("APAR [μmol/m²/s]")
-ylabel("gs")
-legend()
-gcf()
-#----------------------------------------------------------------------------
-
-
-# ## More complex examples:
-
-##Again, this looks tedious and repetitive but is the easiest way to do this right now:
-
-## Now I want to vary T, APAR and CO2:
-## Start CO2 from 100 ppm to make sure it is higher than Γ*
-APAR = [100.0, 250.0, 500.0, 1000.0, 1500.0]
-CO2  = collect(100:20:800)
-T    = collect(274:2:310)
-
-n1 = length(APAR);
-n2 = length(CO2);
-n3 = length(T);
-
-Ag_C3 = zeros(n1,n2,n3); Ag_C4 = zeros(n1,n2,n3)
-An_C3 = zeros(n1,n2,n3); An_C4 = zeros(n1,n2,n3)
-Aj_C3 = zeros(n1,n2,n3); Aj_C4 = zeros(n1,n2,n3)
-Ap_C3 = zeros(n1,n2,n3); Ap_C4 = zeros(n1,n2,n3)
-Ac_C3 = zeros(n1,n2,n3); Ac_C4 = zeros(n1,n2,n3)
-Cc_C3 = zeros(n1,n2,n3); Cc_C4 = zeros(n1,n2,n3)
-gs_C3 = zeros(n1,n2,n3); gs_C4 = zeros(n1,n2,n3)
-
-#----------------------------------------------------------------------------
-
-## Run this over all potential 3D dimensions:
-
-## I really like the compact form of nested loops in Julia!
-for iA in eachindex(APAR), iC in eachindex(CO2), iT in eachindex(T)
-    #println(iA, "/", iC, "/", iT)
-    envir.p_a  = CO2[iC]/10;
-    leaf3.T    = T[iT];
-    leaf3.APAR = APAR[iA];
-    leaf4.T    = T[iT];
-    leaf4.APAR = APAR[iA];
-
-    ## Run C3 photosynthesis:
-    leaf_photo_from_envir!(modC3, leaf3, envir, modC3.Sto);
-    
-    ## Save leaf variables:
-    An_C3[iA,iC,iT]=leaf3.An;
-    Ag_C3[iA,iC,iT]=leaf3.Ag;
-    Aj_C3[iA,iC,iT]=leaf3.Aj;
-    Ap_C3[iA,iC,iT]=leaf3.Ap;
-    Ac_C3[iA,iC,iT]=leaf3.Ac;
-    Cc_C3[iA,iC,iT]=leaf3.p_i;
-    gs_C3[iA,iC,iT]=leaf3.g_sw;
-    
-    ## Run C4 photosynthesis:
-    leaf_photo_from_envir!(modC4, leaf4, envir, modC4.Sto);
-    
-    ## Save leaf variables:
-    An_C4[iA,iC,iT]=leaf4.An;
-    Ag_C4[iA,iC,iT]=leaf4.Ag;
-    Aj_C4[iA,iC,iT]=leaf4.Aj;
-    Ap_C4[iA,iC,iT]=leaf4.Ap;
-    Ac_C4[iA,iC,iT]=leaf4.Ac;
-    Cc_C4[iA,iC,iT]=leaf4.p_i;
-    gs_C4[iA,iC,iT]=leaf4.g_sw;
-end
-#----------------------------------------------------------------------------
-
-# #### Plotting 2D contours of A$_n$ vs. CO$_2$ and Temperature
-
-##Let's take one slice in APAR space:
-i = 4
-
-## and plot:
-figure()
-contourf(T.-273.15, CO2, An_C3[i,:,:])
-xlabel("T [°C]")
-ylabel("Ambient CO₂ [ppm]")
-title("C3 , An [μmol/m²/s] at APAR=$(APAR[i])")
-colorbar()
-gcf()
-#----------------------------------------------------------------------------
-
-## Same for C4 plants, why is it so different??
-
-figure()
-contourf(T.-273.15, CO2, Cc_C4[i,:,:])
-xlabel("T [°C]")
-ylabel("Ambient CO₂ [ppm]")
-title("C4 , Cc [Pa] at APAR=$(APAR[i])")
-colorbar()
-gcf()
-#----------------------------------------------------------------------------
-
-
-## Same for C4 plants, why is it so different??
-
-figure()
-contourf(T.-273.15, CO2, An_C4[i,:,:])
-xlabel("T [°C]")
-ylabel("Ambient CO₂ [ppm]")
-title("C4 , An [μmol/m²/s] at APAR=$(APAR[i])")
-colorbar()
-gcf()
-#----------------------------------------------------------------------------
-
-# ## Ambient CO$_2$ response curves and limiting rates for C3 and C4
-
-iA = 4; iT=12
-figure()
-plot( CO2, Ag_C3[iA,:,iT],color=:black,lw=2, alpha=0.7, label="Ag C3")
-plot(CO2, Ac_C3[iA,:,iT], ls="--", lw=2, label="Ac C3")
-plot(CO2, Aj_C3[iA,:,iT], ls="--", lw=2, label="Aj C3")
-plot(CO2, Ap_C3[iA,:,iT], ls="--", lw=2, label="Ap C3" )
-xlabel("CO₂ [ppm]")
-ylabel("Aᵢ [μmol/m2/s]")
-title("Ambient C3 CO₂ response, T=$(T[iT]-273), APAR=$(APAR[iA])")
-legend()
-gcf()
-
-#----------------------------------------------------------------------------
-
-iA = 4; iT=12
-figure()
-plot(CO2, Ag_C4[iA,:,iT],color=:black,lw=2, alpha=0.7, label="Ag C4")
-plot(CO2, Ac_C4[iA,:,iT], ls="--", lw=2, label="Ac C4")
-plot(CO2, Aj_C4[iA,:,iT], ls="--", lw=2, label="Aj C4")
-plot(CO2, Ap_C4[iA,:,iT], ls="--", lw=2, label="Ap C4")
-xlabel("CO₂ [ppm]")
-ylabel("Aᵢ [μmol/m2/s]")
-title("Ambient C4 CO₂ response, T=$(T[iT]-273), APAR=$(APAR[iA])")
-legend()
-gcf()
-
-#----------------------------------------------------------------------------
-
-# --- 
-# ## Summary:
-# Play around a bit with different parameters. You can also try to change humidity at the leaf level or the boundary layer resistance. There are ## many things that can be tested, and we often like to go to the extremes (T, CO$_2$, ra) to check for bugs, which most often have to do with the ## A-C$_c$ iterations. 
-# 
-# Note of caution: we really plotted CO$_2$ response curves against ambient CO$_2$. At low C$_c$, leaves can be a source of CO$_2$ due to the CO$_2$ compensation point (i.e. A$_g$ can be negative!). Also, at CO$_2$=0, stomatal conductance using the empirical formulation goes to $\infty$, which can cause unwanted behavior. 
-# 
-# Test things out, learn by changing parameters and try to break it!
-
-
-#----------------------------------------------------------------------------
diff --git a/docs/src/tutorial_scripts/Leaf-Photosynthesis.jl b/docs/src/tutorial_scripts/Leaf-Photosynthesis.jl
deleted file mode 100644
index 1692cc34..00000000
--- a/docs/src/tutorial_scripts/Leaf-Photosynthesis.jl
+++ /dev/null
@@ -1,184 +0,0 @@
-
-# # Leaf Photosynthesis Basics
-# This tutorial will walk you through the most basic aspects of how we implement Photosynthesis at the leaf level. Most of the concepts are described in the literature, with the first quantitative approach to modeling photosynthesis given in Farquhar, von Caemmerer and Berry[^1] in their seminal 1980 paper for C3 photosynthesis. C4 photosynthesis is largely based on Collatz et al[^2] but we approach the photosynthesis modeling with a rather generic approach that facilitates the application of different photosynthesis modeling approaches without changing the core code base. A good overview on the entire process of photosynthesis and different parameterizations can be found in Bonan[^3]. 
-# 
-# At the core of both C3 and C4 photosynthesis is an enzyme catalyzed reaction of ribulose-1,5-bisphosphate (RuBP) with 
-# CO$_2$, yielding two 3-carbon compounds (phosphoglycerate (PGA)) as the initial products of photosynthesis. The enzyme RuBP carboxylase/oxygenase (Rubisco) catalyzes this reaction. With the regeneration of the substrate RuBP through the light reactions (using produced ATP and NADPH), the core cycle of photosynthesis is formed. This cycle was discovered in 1950 by Melvin Calvin, James Bassham, and Andrew Benson at the University of California, Berkeley[^4][^5] by using the radioactive isotope carbon-14.
-# 
-# An oxygenation step of RuBP releases half a CO$_2$. This so called photorespiration process results in inefficiencies in C3 photosynthesis, as both CO$_2$ and O$_2$ compete at the Rubisco site. The overall photosynthetic rate of the enzyme-catalyzed turnover rates at the Rubisco site thus determine the overall photosynthesis
-# 
-# $$A_n = V_c - 0.5V_o - R_d\,,$$
-# 
-# with $V_c$ being the carboxylation rate, $V_o$ the oxygenation rate and $R_d$ the mitochondrial respiration. Both rates follow Michaelis-Menten kinetics, accounting for the competing substrate effects:
-# 
-# $$V_c = \frac{V_{c,max}C_c}{C_c+K_c(1+O_c/K_o)}$$
-# 
-# $$V_o = \frac{V_{o,max}O_c}{O_c+K_o(1+C_c/K_c)}\,$$
-# 
-# with $K_c$ and $K_o$ being the Michaelis Menten constants for CO$_2$ and O$_2$, $C_c$ and $O_c$ the partial pressures of CO$_2$ and O$_2$ at the Rubisco site.
-# 
-# The ratio of oxygenation to carboxylation rates is
-# 
-# $$\phi = \frac{V_o}{V_c} = \frac{V_{o,max}K_c}{V_{c,max}K_o}\frac{O_c}{C_c}\,$$ 
-# 
-# which yields the CO$_2$ compensation point $\Gamma_\star$:
-# 
-# $$\Gamma_\star = 0.5\frac{V_{o,max}K_c}{V_{c,max}K_o}O_c\,$$ 
-# 
-# with is the internal CO$_2$ partial pressure at which oxygenation and carboxylation cancel each other out in terms of CO$_2$ consumption and production (neglecting $R_d$).
-# 
-# 
-# 
-# 
-# [^1]: Farquhar, G.D., von Caemmerer, S.V. and Berry, J.A., 1980. A biochemical model of photosynthetic CO$_2$ assimilation in leaves of C3 species. Planta, 149(1), pp.78-90.
-# 
-# [^2]: Collatz, G.J., Ribas-Carbo, M. and Berry, J.A., 1992. Coupled photosynthesis-stomatal conductance model for leaves of C4 plants. Functional Plant Biology, 19(5), pp.519-538.
-# 
-# [^3]: Bonan, G., 2019. Climate change and terrestrial ecosystem modeling. Cambridge University Press.
-# 
-# [^4]: Calvin, Melvin, and Andrew Alm Benson. "The path of carbon in photosynthesis IV: the identity and sequence of the intermediates in sucrose synthesis." Science 109, no. 2824 (1949): 140-142.
-# 
-# [^5]: Benson, A.A., Bassham, J.A., Calvin, M., Goodale, T.C., Haas, V.A. and Stepka, W., 1950. The path of carbon in photosynthesis. v. paper chromatography and radioautography of the products1. Journal of the American Chemical Society, 72(4), pp.1710-1718.
-# 
-
-# ## Rate Limiting Steps for photosynthesis
-# 
-# ### Rubisco-limited rates:
-# The net photosynthetic rate limited by Rubisco when RuBP re-generation is not constraining can thus be described as 
-# 
-# $$A_n = \left(1-\frac{\Gamma_\star}{C_c}\right)V_c-R_d\,$$
-# 
-# which equals (now denoting $A_c$ as the Rubisco limited rate):
-# 
-# $$A_c = \frac{(C_c-\Gamma_\star) V_{c,max}}{C_c+K_c(1+O_c/K_o)}\,$$
-# 
-# which is implemented in our routines "rubisco_limited_rate!".
-# 
-# ### RuBP-regeration limited rates (light-limited):
-# 
-# RuBP is regenerated via the ligh reaction, which generates ATP and NADP to power this part of the Calvin-Benson-Bassham cycle. Without going into details of the NADPH or ATP requirements for regeneration, the rate of RuBP limited photosynthesis through light-powered electron transport $J$ (µmol/m$^2$/s) is given as 
-# 
-# $$A_j = \underbrace{\frac{C_c-\Gamma_\star}{Cc}}_{\text{loss in photorespiration}}\underbrace{\frac{J\,C_c}{4C_c+8\Gamma_\star}}_{\text{RuBP regeneration}} = \frac{J(C_c-\Gamma_\star)}{4C_c+8\Gamma_\star}\,$$
-# 
-# One can already see what the key difference between C3 and C4 photosynthesis is based on these set of equation for rubisco turnover and RuBP-regeneration limited rates. In C4 photosynthesis, $C_c$ is typically only about 70% of the ambient CO$_2$ concentration as CO$_2$ has to diffuse through stomata and the mesophyll. For C4, a carbon accumulation mechanism uses a four-carbon organic acid (hence C4) to transport CO$_2$ from the mesophyll cells to the bundle sheath cells, where the reaction with Rubisco takes place. This leads to much higher $C_c$ for C4 plants ($>>$ than ambient air CO$_2$), which is often simplified for $A_c$ as the limit of C3 equation with $\lim_{C_c \to \infty}$ Ac(C3):
-# 
-# $$A_c^{C4} = V_{c,max}$$
-# 
-# Similarly, the RuBP-regeneration limited rate simplifies to:
-# 
-# $$A_j^{C4} = \alpha J$$
-# 
-# with a slightly lower efficiency $\alpha$ for C4 photosynthesis compared to C3 (as the carbon accumulation mechanism also consumes ATP). In reality, the situation is somewhat more complex and there are different approximations for Rubisco and RuBP limited rate constants. A comprehensive overview is described in von Caemmerer [^6]. Again, our goal is to provide a flexible framework for photosynthesis modeling, so different implementations of rate limiting steps $A_c,A_j$ can be used in a modular framework (achieved through code abstraction and multiple dispatch in Julia).
-# 
-# ### Electron Transport Rate $J$
-# 
-# The rate of electron transport is driven by absorbed photosynthetically absorbed radiation (APAR, $\mu mol/m^2/s$) by Photosystem II (PSII). With our leaf level optical model, we already compute the efficiency of absorbtion by leaves depending on pigment contents. We define $\varphi_{PSII}$ as the quantum yield of photosystem II (maxima about 0.83) and $f_{PSII}$ the fraction of light used for PSII (PSII/(PSI+PSII)), typically assume to be 0.5.
-# 
-# $$J_{PSII} = f_{PSII} \varphi_{PSII} APAR$$
-# 
-# In most models, a maximum electron transport $J_{max}$ rate is assumed and the actual electron trapsort rate $J_a$ is defined as the lower root of the quadratic expression
-# 
-# $$\Theta_j J_a^2 -(J_{PSII}+J_{max})+ J_{PSII}J_{max} = 0$$
-# 
-# where $\Theta_j$ is a curvature parameter to assure a smooth transition. 
-# 
-# ### Product limited rates:
-# 
-# Typically, a thrid limitation of photosynthesis is being used as well, which we denote as product limited rate here, even though the processes for C3 and C4 plants differ. Typically, the export of the products of photosynthesis (triose phosphates) in the synthesis of sugars can be rate limiting, which is often parameterized by $V_{c,max}$:
-# 
-# $$A_p = a V_{c,max}\,,$$
-# 
-# where our standard definition for C3 used a=0.5, which rarely limits photosynthesis compared to $A_c$ and $A_j$.
-# 
-# For C4 plants, we use the PEP-carboxylase CO$_2$ concentration mechanism into the bundle sheath cell as product limited rate step, using Michaelis-Menten kinetics:
-# 
-# $$A_p^{C4} = \frac{V_{p,max}C_c}{C_c + K_p}$$
-# 
-# with corresponding Michaelis Menten constant $K_p$ and maximal rates $V_{p,max}$.
-# 
-# 
-# ### Total rate:
-# 
-# The gross photosynthetic rate $A_g$ can then be define as the mininum of all possible limitations:
-# 
-# $$A_g = min(Ac,Aj,Ap)$$
-# 
-# or, alternatively, using quadratic equations as for $J$, which provides smoother transitions and co-limitation to some degree (both are options in our setup with a user defined curvature parameter $\Theta$.
-# 
-# Net leaf photosynthesis includes mitochondrial respiration as well:
-# 
-# $$A_n = A_g - R_d$$
-# 
-# [^6]: Von Caemmerer, S., 2000. Biochemical models of leaf photosynthesis. Csiro publishing.
-
-# ## Simple example:
-# We just want to lay out a first simple example as to how our model setup work:  
-
-## Loading the Photosynthesis model:
-using Land.Photosynthesis
-## Defining our Field Type (we can easily switch between Double and Float precision this way)
-const FT = Float32;
-#----------------------------------------------------------------------------
-
-## Create a standard leaf with defualt parameters
-leaf = Leaf{FT}();
-
-## Create a standard meteo structure:
-envir = AirLayer{FT}();
-#----------------------------------------------------------------------------
-
-# ----
-# How to use the documentation, what do we know about leaf_params, which stores most physiologically relevant parameters. (Not printed here, try in the command line! Type in, do not copy and paste!).
-
-##?LeafParams
-#----------------------------------------------------------------------------
-
-##?MeteoParams
-#----------------------------------------------------------------------------
-
-# ### Defining the model setup
-# The most important step is to define which submodules to use. There might be different implementations for Fluorescence, Photosynthesis (C3,C4,etc), respiration, stomatal conductance (e.g. Ball-Berry, Medlyn), the T-dependence of J$_{max}$, V$_{c,max}$ and Michaelis Menten constants as well as leaf boundary layer resistance (setting it to 0 here to mimic well vented laboratory leaf level measurements) and colimitation.   
-
-##Here, we just have to worry abou the photosynthesis module, which we set here:
-#mod_photo = C3FvCBPhoto()
-
-## All modules here:
-const photo_set = C3CLM(FT);
-#----------------------------------------------------------------------------
-
-## Set APAR to 250 $\mu mol/m^2/s$
-leaf.APAR = 250;
-## Set temperature to 290K
-leaf.T = 290;
-## Applying the T-correction for all the rate constants
-photo_temperature_dependence!(photo_set, leaf, envir);
-@show leaf.Vcmax, leaf.Vcmax25;
-#----------------------------------------------------------------------------
-
-@show leaf.Jmax, leaf.Jmax25;
-#----------------------------------------------------------------------------
-
-## Specify Cc directly here in Pa
-leaf.p_i = 35;
-## update radiation dependent values first, like ETR
-photo_radiation_dependence!(photo_set, leaf);
-## update p_i dependent photosynthetic rates
-photo_CO₂_dependence!(photo_set, leaf);
-@show leaf.Ac;
-#----------------------------------------------------------------------------
-
-@show leaf.Aj;
-#----------------------------------------------------------------------------
-
-@show leaf.Ap;
-#----------------------------------------------------------------------------
-
-@show leaf.An;
-#----------------------------------------------------------------------------
-
-# ----
-# ### Summary
-# This was the simplest example to compute A$_c$, A$_j$ and A$_p$ with a specified C$_c$ and APAR. In reality, C$_c$ is defined by the interplay of photosynthetic demand and the supply through diffusion through stomata and the mesophyll. However, you can easily exchange the photosynthesis model above with C4FvCBPhoto(). You can also play around with leaf temperature T and APAR as well as $C_c$. But remember to use the right function.
-
-#?Leaf
-#----------------------------------------------------------------------------
diff --git a/docs/src/tutorial_scripts/Photosynthesis/1_basics.jl b/docs/src/tutorial_scripts/Photosynthesis/1_basics.jl
deleted file mode 100644
index 2283482d..00000000
--- a/docs/src/tutorial_scripts/Photosynthesis/1_basics.jl
+++ /dev/null
@@ -1,111 +0,0 @@
-# # Leaf Photosynthesis Basics
-# This tutorial will walk you through the most basic aspects of how we implement Photosynthesis at the leaf level. Most of the concepts are described in the literature, with the first quantitative approach to modeling photosynthesis given in Farquhar, von Caemmerer and Berry[^1] in their seminal 1980 paper for C3 photosynthesis. C4 photosynthesis is largely based on Collatz et al[^2] but we approach the photosynthesis modeling with a rather generic approach that facilitates the application of different photosynthesis modeling approaches without changing the core code base. A good overview on the entire process of photosynthesis and different parameterizations can be found in Bonan[^3]. 
-# 
-# At the core of both C3 and C4 photosynthesis is an enzyme catalyzed reaction of ribulose-1,5-bisphosphate (RuBP) with 
-# CO₂, yielding two 3-carbon compounds (phosphoglycerate (PGA)) as the initial products of photosynthesis. The enzyme RuBP carboxylase/oxygenase (Rubisco) catalyzes this reaction. With the regeneration of the substrate RuBP through the light reactions (using produced ATP and NADPH), the core cycle of photosynthesis is formed. This cycle was discovered in 1950 by Melvin Calvin, James Bassham, and Andrew Benson at the University of California, Berkeley[^4][^5] by using the radioactive isotope carbon-14.
-# 
-# An oxygenation step of RuBP releases half a CO₂. This so called photorespiration process results in inefficiencies in C3 photosynthesis, as both CO₂ and O₂ compete at the Rubisco site. The overall photosynthetic rate of the enzyme-catalyzed turnover rates at the Rubisco site thus determine the overall photosynthesis
-# 
-# $$A_n = V_c - 0.5V_o - R_d\,,$$
-# 
-# with $V_c$ being the carboxylation rate, $V_o$ the oxygenation rate and $R_d$ the mitochondrial respiration. Both rates follow Michaelis-Menten kinetics, accounting for the competing substrate effects:
-# 
-# $$V_c = \frac{V_{c,max}C_c}{C_c+K_c(1+O_c/K_o)}$$
-# 
-# $$V_o = \frac{V_{o,max}O_c}{O_c+K_o(1+C_c/K_c)}\,$$
-# 
-# with $K_c$ and $K_o$ being the Michaelis Menten constants for CO₂ and O₂, $C_c$ and $O_c$ the partial pressures of CO₂ and O₂ at the Rubisco site.
-# 
-# The ratio of oxygenation to carboxylation rates is
-# 
-# $$\phi = \frac{V_o}{V_c} = \frac{V_{o,max}K_c}{V_{c,max}K_o}\frac{O_c}{C_c}\,$$ 
-# 
-# which yields the CO₂ compensation point $\Gamma^\star$:
-# 
-# $$\Gamma^\star = 0.5\frac{V_{o,max}K_c}{V_{c,max}K_o}O_c\,$$ 
-# 
-# with is the internal CO₂ partial pressure at which oxygenation and carboxylation cancel each other out in terms of CO₂ consumption and production (neglecting $R_d$).
-# 
-# 
-# 
-# 
-# [^1]: Farquhar, G.D., von Caemmerer, S.V. and Berry, J.A., 1980. A biochemical model of photosynthetic CO₂ assimilation in leaves of C3 species. Planta, 149(1), pp.78-90.
-# 
-# [^2]: Collatz, G.J., Ribas-Carbo, M. and Berry, J.A., 1992. Coupled photosynthesis-stomatal conductance model for leaves of C4 plants. Functional Plant Biology, 19(5), pp.519-538.
-# 
-# [^3]: Bonan, G., 2019. Climate change and terrestrial ecosystem modeling. Cambridge University Press.
-# 
-# [^4]: Calvin, Melvin, and Andrew Alm Benson. "The path of carbon in photosynthesis IV: the identity and sequence of the intermediates in sucrose synthesis." Science 109, no. 2824 (1949): 140-142.
-# 
-# [^5]: Benson, A.A., Bassham, J.A., Calvin, M., Goodale, T.C., Haas, V.A. and Stepka, W., 1950. The path of carbon in photosynthesis. v. paper chromatography and radioautography of the products1. Journal of the American Chemical Society, 72(4), pp.1710-1718.
-# 
-# ## Rate Limiting Steps for photosynthesis
-# 
-# ### Rubisco-limited rates:
-# The net photosynthetic rate limited by Rubisco when RuBP re-generation is not constraining can thus be described as 
-# 
-# $$A_n = \left(1-\frac{\Gamma_\star}{C_c}\right)V_c-R_d\,$$
-# 
-# which equals (now denoting $A_c$ as the Rubisco limited rate):
-# 
-# $$A_c = \frac{(C_c-\Gamma_\star) V_{c,max}}{C_c+K_c(1+O_c/K_o)}\,$$
-# 
-# which is implemented in our routines "rubisco_limited_rate!".
-# 
-# ### RuBP-regeration limited rates (light-limited):
-# 
-# RuBP is regenerated via the ligh reaction, which generates ATP and NADP to power this part of the Calvin-Benson-Bassham cycle. Without going into details of the NADPH or ATP requirements for regeneration, the rate of RuBP limited photosynthesis through light-powered electron transport $J$ (µmol/m$^2$/s) is given as 
-# 
-# $$A_j = \underbrace{\frac{C_c-\Gamma_\star}{Cc}}_{\text{loss in photorespiration}}\underbrace{\frac{J\,C_c}{4C_c+8\Gamma_\star}}_{\text{RuBP regeneration}} = \frac{J(C_c-\Gamma_\star)}{4C_c+8\Gamma_\star}\,$$
-# 
-# One can already see what the key difference between C3 and C4 photosynthesis is based on these set of equation for rubisco turnover and RuBP-regeneration limited rates. In C4 photosynthesis, $C_c$ is typically only about 70% of the ambient CO₂ concentration as CO₂ has to diffuse through stomata and the mesophyll. For C4, a carbon accumulation mechanism uses a four-carbon organic acid (hence C4) to transport CO₂ from the mesophyll cells to the bundle sheath cells, where the reaction with Rubisco takes place. This leads to much higher $C_c$ for C4 plants ($>>$ than ambient air CO₂), which is often simplified for $A_c$ as the limit of C3 equation with $\lim_{C_c \to \infty}$ Ac(C3):
-# 
-# $$A_c^{C4} = V_{c,max}$$
-# 
-# Similarly, the RuBP-regeneration limited rate simplifies to:
-# 
-# $$A_j^{C4} = \alpha J$$
-# 
-# with a slightly lower efficiency $\alpha$ for C4 photosynthesis compared to C3 (as the carbon accumulation mechanism also consumes ATP). In reality, the situation is somewhat more complex and there are different approximations for Rubisco and RuBP limited rate constants. A comprehensive overview is described in von Caemmerer [^6]. Again, our goal is to provide a flexible framework for photosynthesis modeling, so different implementations of rate limiting steps $A_c,A_j$ can be used in a modular framework (achieved through code abstraction and multiple dispatch in Julia).
-# 
-# ### Electron Transport Rate $J$
-# 
-# The rate of electron transport is driven by absorbed photosynthetically absorbed radiation (APAR, $\mu mol/m^2/s$) by Photosystem II (PSII). With our leaf level optical model, we already compute the efficiency of absorbtion by leaves depending on pigment contents. We define $\varphi_{PSII}$ as the quantum yield of photosystem II (maxima about 0.83) and $f_{PSII}$ the fraction of light used for PSII (PSII/(PSI+PSII)), typically assume to be 0.5.
-# 
-# $$J_{PSII} = f_{PSII} \varphi_{PSII} APAR$$
-# 
-# In most models, a maximum electron transport $J_{max}$ rate is assumed and the actual electron trapsort rate $J_a$ is defined as the lower root of the quadratic expression
-# 
-# $$\Theta_j J_a^2 -(J_{PSII}+J_{max})+ J_{PSII}J_{max} = 0$$
-# 
-# where $\Theta_j$ is a curvature parameter to assure a smooth transition. 
-# 
-# ### Product limited rates:
-# 
-# Typically, a thrid limitation of photosynthesis is being used as well, which we denote as product limited rate here, even though the processes for C3 and C4 plants differ. Typically, the export of the products of photosynthesis (triose phosphates) in the synthesis of sugars can be rate limiting, which is often parameterized by $V_{c,max}$:
-# 
-# $$A_p = a V_{c,max}\,,$$
-# 
-# where our standard definition for C3 used a=0.5, which rarely limits photosynthesis compared to $A_c$ and $A_j$.
-# 
-# For C4 plants, we use the PEP-carboxylase CO₂ concentration mechanism into the bundle sheath cell as product limited rate step, using Michaelis-Menten kinetics:
-# 
-# $$A_p^{C4} = \frac{V_{p,max}C_c}{C_c + K_p}$$
-# 
-# with corresponding Michaelis Menten constant $K_p$ and maximal rates $V_{p,max}$.
-# 
-# 
-# ### Total rate:
-# 
-# The gross photosynthetic rate $A_g$ can then be define as the mininum of all possible limitations:
-# 
-# $$A_g = min(Ac,Aj,Ap)$$
-# 
-# or, alternatively, using quadratic equations as for $J$, which provides smoother transitions and co-limitation to some degree (both are options in our setup with a user defined curvature parameter $\Theta$.
-# 
-# Net leaf photosynthesis includes mitochondrial respiration as well:
-# 
-# $$A_n = A_g - R_d$$
-# 
-# [^6]: Von Caemmerer, S., 2000. Biochemical models of leaf photosynthesis. Csiro publishing.
-# 
diff --git a/docs/src/tutorial_scripts/Photosynthesis/2_temperature.jl b/docs/src/tutorial_scripts/Photosynthesis/2_temperature.jl
deleted file mode 100644
index fc70b96c..00000000
--- a/docs/src/tutorial_scripts/Photosynthesis/2_temperature.jl
+++ /dev/null
@@ -1,228 +0,0 @@
-# # Rate Constants and T-Dependency
-# 
-# Here, we will just briefly summarize how temperature affects enzymatic rate constants and how much uncertainty there actually is in literature (in terms of how to best define them and how plastic some of the variables are)
-
-## Add usual tools we use:
-using BenchmarkTools
-using PyPlot
-
-#----------------------------------------------------------------------------
-
-## load Photosynthesis module: 
-using Land.Photosynthesis
-#----------------------------------------------------------------------------
-
-## Specify Field Type
-const FT = Float32;
-#----------------------------------------------------------------------------
-
-# ## T-dependence
-# In literature, there are different implementations of the temperature dependence of enzymatic reaction rates. Common among all of them is a typical Arrhenius formulation with Activation energy $E_a$, which leads to a temperature dependence of a quantity $V$ given the standard value defined at 25 °C as $T_{ref}$.
-# 
-# $$V(T)= V(T_{ref})\, \underbrace{\exp\left(\frac{E_a}{RT_{ref}}-\frac{E_a}{RT}\right)}_{\text{Activation}}$$
-# 
-# Other formulations add de-activation of proteins due to denaturalization at higher temperatures:
-# 
-# $$V(T)= V(T_{ref})\, \exp\left(\frac{E_a}{RT_{ref}}-\frac{E_a}{RT}\right) \underbrace{\frac{1+\exp\left[(\Delta ST_{ref}-H_d)/RT_{ref}\right]}{1+\exp\left[(\Delta ST-H_d)/RT\right]}}_{\text{de-activation}}$$
-# 
-# which includes an entropy term $\Delta S$ and the energy for deactivation $H_d$.
-# 
-# To illustrate the differences, we show two different implementations, one only using the activation part based on Bernacchi et al 2001[^1] and one with the typical CLM5 implementation.
-# 
-# The T-Dependency applies to $V_{max}$, $J_{max}$, $K_{c}$, $K_{o}$, $K_{pep}$, Respiration, and $\Gamma^{*}$, and there are multiple parameter sets for each of the parameters. Below, we show the differences of the sets for each of $V_{max}$, $J_{max}$, $K_{c}$, $K_{o}$, $K_{pep}$, Respiration, and $\Gamma^{*}$.
-# 
-# [^1]: Bernacchi, C.J., Singsaas, E.L., Pimentel, C., Portis Jr, A.R. and Long, S.P., 2001. Improved temperature response functions for models of Rubisco‐limited photosynthesis. Plant, Cell & Environment, 24(2), pp.253-259.
-# 
-# ### $V_{cmax}$
-#
-
-## Bernacchi set
-vc_td_bernacchi = Photosynthesis.VcmaxTDBernacchi(FT)
-## CLM set
-vc_td_clm       = Photosynthesis.VcmaxTDCLM(FT)
-## Leuning set
-vc_td_leuning   = Photosynthesis.VcmaxTDLeuning(FT)
-
-## an array of temperature from 10 to 50 degree C
-t_array = collect(FT, 10:50) .+ FT(273.15)
-vcm_bernacchi = photo_TD_from_val(vc_td_bernacchi, FT(60), t_array)
-vcm_clm       = photo_TD_from_val(vc_td_clm      , FT(60), t_array)
-vcm_leuning   = photo_TD_from_val(vc_td_leuning  , FT(60), t_array)
-
-## plot the TD curves
-figure(figsize=(8,6), dpi=100)
-tight_layout(true)
-plot(t_array, vcm_bernacchi, "r-", label="Bernacchi")
-plot(t_array, vcm_clm      , "g-", label="CLM5"     )
-plot(t_array, vcm_leuning  , "b-", label="Leuning"  )
-xlabel("Temperature (K)"            , fontsize=16)
-ylabel("\$V_{cmax}\$ (μmol m⁻² s⁻¹)", fontsize=16)
-legend(loc="upper left")
-gcf()
-#----------------------------------------------------------------------------
-
-# ### $V_{pmax}$
-#
-
-## Boyd set
-vp_td_boyd = Photosynthesis.VpmaxTDBoyd(FT)
-
-## an array of temperature from 10 to 50 degree C
-vpm_boyd = photo_TD_from_val(vp_td_boyd, FT(60), t_array)
-
-## plot the TD curves
-figure(figsize=(8,6), dpi=100)
-tight_layout(true)
-plot(t_array, vpm_boyd, "r-", label="Boyd")
-xlabel("Temperature (K)"            , fontsize=16)
-ylabel("\$V_{pmax}\$ (μmol m⁻² s⁻¹)", fontsize=16)
-legend(loc="upper left")
-gcf()
-#----------------------------------------------------------------------------
-
-# ### $J_{max}$
-#
-
-## Bernacchi set
-j_td_bernacchi = Photosynthesis.JmaxTDBernacchi(FT)
-## CLM set
-j_td_clm       = Photosynthesis.JmaxTDCLM(FT)
-## Leuning set
-j_td_leuning   = Photosynthesis.JmaxTDLeuning(FT)
-
-## an array of temperature from 10 to 50 degree C
-jm_bernacchi = photo_TD_from_val(j_td_bernacchi, FT(120), t_array)
-jm_clm       = photo_TD_from_val(j_td_clm      , FT(120),  t_array)
-jm_leuning   = photo_TD_from_val(j_td_leuning  , FT(120),  t_array)
-
-## plot the TD curves
-figure(figsize=(8,6), dpi=100)
-tight_layout(true)
-plot(t_array, jm_bernacchi, "r-", label="Bernacchi")
-plot(t_array, jm_clm      , "g-", label="CLM5"     )
-plot(t_array, jm_leuning  , "b-", label="Leuning"  )
-xlabel("Temperature (K)"           , fontsize=16)
-ylabel("\$J_{max}\$ (μmol m⁻² s⁻¹)", fontsize=16)
-legend(loc="upper left")
-gcf()
-#----------------------------------------------------------------------------
-
-# ### $K_{c}$
-#
-
-## Bernacchi set
-kc_td_bernacchi = Photosynthesis.KcTDBernacchi(FT)
-## CLM set
-kc_td_clm       = Photosynthesis.KcTDCLM(FT)
-
-## an array of temperature from 10 to 50 degree C
-kc_bernacchi = photo_TD_from_set(kc_td_bernacchi, t_array)
-kc_clm       = photo_TD_from_set(kc_td_clm      , t_array)
-
-## plot the TD curves
-figure(figsize=(8,6), dpi=100)
-tight_layout(true)
-plot(t_array, kc_bernacchi, "r-", label="Bernacchi")
-plot(t_array, kc_clm      , "g-", label="CLM5"     )
-xlabel("Temperature (K)", fontsize=16)
-ylabel("\$K_{c}\$ (Pa)" , fontsize=16)
-legend(loc="upper left")
-gcf()
-#----------------------------------------------------------------------------
-
-# ### $K_{o}$
-#
-
-## Bernacchi set
-ko_td_bernacchi = Photosynthesis.KoTDBernacchi(FT)
-## CLM set
-ko_td_clm       = Photosynthesis.KoTDCLM(FT)
-
-## an array of temperature from 10 to 50 degree C
-ko_bernacchi = photo_TD_from_set(ko_td_bernacchi, t_array)
-ko_clm       = photo_TD_from_set(ko_td_clm      , t_array)
-
-## plot the TD curves
-figure(figsize=(8,6), dpi=100)
-tight_layout(true)
-plot(t_array, ko_bernacchi, "r-", label="Bernacchi")
-plot(t_array, ko_clm      , "g-", label="CLM5"     )
-xlabel("Temperature (K)", fontsize=16)
-ylabel("\$K_{o}\$ (Pa)" , fontsize=16)
-legend(loc="upper left")
-gcf()
-#----------------------------------------------------------------------------
-
-# ### $K_{pep}$
-#
-
-## Boyd set
-kpep_td_boyd = Photosynthesis.KpepTDBoyd(FT)
-## CLM set
-kpep_td_clm  = Photosynthesis.KpepTDCLM(FT)
-
-## an array of temperature from 10 to 50 degree C
-kpep_boyd = photo_TD_from_set(kpep_td_boyd, t_array)
-kpep_clm  = photo_TD_from_set(kpep_td_clm , t_array)
-
-## plot the TD curves
-figure(figsize=(8,6), dpi=100)
-tight_layout(true)
-plot(t_array, kpep_boyd, "r-", label="Boyd")
-plot(t_array, kpep_clm , "g-", label="CLM5")
-xlabel("Temperature (K)" , fontsize=16)
-ylabel("\$K_{pep}\$ (Pa)", fontsize=16)
-legend(loc="upper left")
-gcf()
-#----------------------------------------------------------------------------
-
-# ### Respiration
-#
-
-## Bernacchi set
-re_td_bernacchi = Photosynthesis.RespirationTDBernacchi(FT)
-## CLM set
-re_td_clm       = Photosynthesis.RespirationTDCLM(FT)
-
-## an array of temperature from 10 to 50 degree C
-re_bernacchi = photo_TD_from_val(re_td_bernacchi, FT(1.0), t_array)
-re_clm       = photo_TD_from_val(re_td_clm      , FT(1.0), t_array)
-
-## plot the TD curves
-figure(figsize=(8,6), dpi=100)
-tight_layout(true)
-plot(t_array, re_bernacchi, "r-", label="Bernacchi")
-plot(t_array, re_clm      , "g-", label="CLM5"     )
-xlabel("Temperature (K)"                , fontsize=16)
-ylabel("Respiration Rate (μmol m⁻² s⁻¹)", fontsize=16)
-legend(loc="upper left")
-gcf()
-#----------------------------------------------------------------------------
-
-# ### $\Gamma^{*}$
-#
-
-## Bernacchi set
-Γs_td_bernacchi = Photosynthesis.ΓStarTDBernacchi(FT)
-## CLM set
-Γs_td_clm       = Photosynthesis.ΓStarTDCLM(FT)
-
-## an array of temperature from 10 to 50 degree C
-Γs_bernacchi = photo_TD_from_set(Γs_td_bernacchi, t_array)
-Γs_clm       = photo_TD_from_set(Γs_td_clm      , t_array)
-
-## plot the TD curves
-figure(figsize=(8,6), dpi=100)
-tight_layout(true)
-plot(t_array, Γs_bernacchi, "r-", label="Bernacchi")
-plot(t_array, Γs_clm      , "g-", label="CLM5"     )
-xlabel("Temperature (K)"     , fontsize=16)
-ylabel("\$\\Gamma^{*}\$ (Pa)", fontsize=16)
-legend(loc="upper left")
-gcf()
-#----------------------------------------------------------------------------
-
-# ## Summary 
-# The way land surface models implement temperature variations in $V_{c,max}$ is still rather variable and there is no clear consensus in what model is best. In addition, gas exchange datasets performed at different temperatures might actually alias different confounding factors into the $V_{c,max}$ determination, so that the actually fitted $V_{c,max}$ strongly depends on the model formulation. E.g. mesophyll conductance is usually ignored in deriving $V_{c,max}$ but might be temperature dependent, which can cause T-dependent errors in $V_{c,max}$. Also, the T-dependencies may change with time, known as acclimation of optimal temperature.
-# 
-# That said, having the option to use different model forumations (as well as parameter settings) and actually using the ones that are implemented in land surface models directly when fitting leaf level measurements seems to be a prudent way to improve models in the future. More leaf level data might help in the future, especially looking at temperature dependencies, mesophyll conductance, and fluorescence yields. So many chemical and phsyical aspects change with temperature that it is hard to isolate impacting factors. Now, at least, we can run the models directly in the REPL, which is great for prototyping anc validating the model on the individual module level without any effort in terms of additional coding. 
diff --git a/docs/src/tutorial_scripts/Photosynthesis/3_photosynthesis.jl b/docs/src/tutorial_scripts/Photosynthesis/3_photosynthesis.jl
deleted file mode 100644
index 5ffa40fa..00000000
--- a/docs/src/tutorial_scripts/Photosynthesis/3_photosynthesis.jl
+++ /dev/null
@@ -1,187 +0,0 @@
-# # Leaf Level Photosynthesis 
-# 
-# Here, we will go one step further and look at the entire leaf-level response to different environmental conditions, including the impact of leaf diffusive conductance here. See next tutorial for how stomatal conductance responds to the environment.
-
-# ## Leaf Diffusive Conductance and Stomatal Conductance
-# Before, we focussed mainly on the demand-driven constraints through Rubisco and RuBP regeneration. Leaf diffusive conductance is highly important as it drives the suppy-side of photosynthesis and interacts with the energy balance and leaf temperature as latent heat fluxes are a major factor in surface cooling. 
-# 
-# Before, we have derived net rates of photosynthesis $A_n$, which have to be matched with the supply side through CO₂ diffusion:
-# 
-# $$A_n^{diff} = g_{leaf,C}(C_a-C_c) = g_{leaf,C}\frac{P_a-P_c}{P_{atm}}$$
-# 
-# which can be separated into diffusion from the air to the leaf surface with a boundary layer conductance $g_{b,C}$, diffusion from the surface to the interstitial air-space with stomatal conductance $g_{s,C}$ and diffusion from the  interstitial air-space to the chloroplast with mesophyll conductance $g_{m,C}$ (the letter C stands for CO₂ here, as the diffusion constants vary with species, e.g. H$_2$O stomatal conductance is a factor 1.6 higher than those for CO₂):
-# 
-# $$A_n^{diff} = g_{b,C}(C_a-C_s) = g_{s,C}(C_s-C_i) = g_{m,C}(C_i-C_c) = g_{leaf,C}(C_a-C_c)$$
-# 
-# $$g_{leaf,C} = \left(\frac{1}{g_{b,C}}+\frac{1}{g_{s,C}}+\frac{1}{g_{m,C}}\right)^{-1}$$
-# 
-# The importance of diffusive conductance and its interplay with photosynthesis here is that the supply and demand rates determine $C_c$. A reduction in $C_c$ reduces the demand-limited rates while it increase the diffusion rates (at a given $g$). Most models run internal so-called A-$C_c$ iterations to ensure both rates are balanced and in steady-state ($\partial C_c/\partial t=0$). We implement this option but also opt to run stomatal conductance prognostically, as stomata don't open and close instantanously but have a response time of around 15 minutes.  
-# 
-# Below, we show simple examples of how the environmental conditions and the leaf diffusive conductance impact leaf photosynthesis.
-#
-
-## load packages
-using PyPlot
-using Land.Photosynthesis
-
-## set the default floating type
-FT     = Float32;
-
-## define default photosynthesis parameter sets
-c3_set = C3CLM(FT);
-c4_set = C4CLM(FT);
-
-## define leaf photosynthetic parameters and environmental conditions
-leaf_3 = LeafPhotoContainer{FT}(APAR=1200, Vcmax25=60, Jmax25=120, Vpmax25=80, Rd25=1);
-leaf_4 = LeafPhotoContainer{FT}(APAR=1200, Vcmax25=60, Jmax25=120, Vpmax25=80, Rd25=1);
-envir  = EnvironmentConditions{FT}();
-#----------------------------------------------------------------------------
-
-# ## $A$ ~ $P_c$
-
-## set the internal CO₂ to 30 Pa and temperature to 298.15 K and PAR to 1500
-leaf_3.p_i=30; leaf_3.T=298.15; leaf_3.APAR=1500;
-leaf_4.p_i=30; leaf_4.T=298.15; leaf_4.APAR=1500;
-
-## set an array of internal CO₂
-p_array = collect(FT, 5:200);
-ac_3 = similar(p_array); aj_3 = similar(p_array); ap_3 = similar(p_array); ag_3 = similar(p_array); an_3 = similar(p_array);
-ac_4 = similar(p_array); aj_4 = similar(p_array); ap_4 = similar(p_array); ag_4 = similar(p_array); an_4 = similar(p_array);
-
-## update the temperature and PAR dependent photosynthesis
-Photosynthesis.photosynthesis_TD!(c3_set, leaf_3, envir);
-Photosynthesis.photosynthesis_TD!(c4_set, leaf_4, envir);
-
-
-## update the CO₂ dependent photosynthesis
-for i in eachindex(p_array);
-    p_i = p_array[i];
-    photosynthesis_PD!(c3_set, leaf_3, p_i);
-    photosynthesis_PD!(c4_set, leaf_4, p_i);
-
-    ac_3[i], aj_3[i], ap_3[i], ag_3[i], an_3[i] = leaf_3.Ac, leaf_3.Aj, leaf_3.Ap, leaf_3.Ag, leaf_3.An;
-    ac_4[i], aj_4[i], ap_4[i], ag_4[i], an_4[i] = leaf_4.Ac, leaf_4.Aj, leaf_4.Ap, leaf_4.Ag, leaf_4.An;
-end
-
-## plot the CO₂ responses for C3 and C4 photosynthesis
-figure(figsize=(10,6), dpi=100);
-tight_layout(true);
-subplot(1,2,1);
-plot(p_array, ac_3, "r:", lw=2, label="Ac");
-plot(p_array, aj_3, "b:", lw=2, label="Aj");
-plot(p_array, ap_3, "g:", lw=2, label="Ap");
-plot(p_array, ag_3, "k-", lw=1, label="Ag");
-plot(p_array, an_3, "k:", lw=1, label="An");
-xlabel("Leaf Internal CO₂ (Pa)"            , fontsize=16);
-ylabel("Photosynthetic Rate (μmol m⁻² s⁻¹)", fontsize=16);
-legend(loc="lower right")
-subplot(1,2,2);
-plot(p_array, ac_4, "r:", lw=2, label="Ac");
-plot(p_array, aj_4, "b:", lw=2, label="Aj");
-plot(p_array, ap_4, "g:", lw=2, label="Ap");
-plot(p_array, ag_4, "k-", lw=1, label="Ag");
-plot(p_array, an_4, "k:", lw=1, label="An");
-xlabel("Leaf Internal CO₂ (Pa)"            , fontsize=16);
-legend(loc="lower right")
-gcf()
-#----------------------------------------------------------------------------
-
-# ## $A$ ~ $PAR$
-
-## set the internal CO₂ to 30 Pa and temperature to 298.15 K and PAR to 1500
-leaf_3.p_i=30; leaf_3.T=298.15; leaf_3.APAR=1500;
-leaf_4.p_i=30; leaf_4.T=298.15; leaf_4.APAR=1500;
-
-## set an array of APAR
-par_array = collect(FT, 10:10:2000);
-ac_3 = similar(par_array); aj_3 = similar(par_array); ap_3 = similar(par_array); ag_3 = similar(par_array); an_3 = similar(par_array);
-ac_4 = similar(par_array); aj_4 = similar(par_array); ap_4 = similar(par_array); ag_4 = similar(par_array); an_4 = similar(par_array);
-
-for i in eachindex(par_array);
-    leaf_3.APAR = par_array[i];
-    leaf_4.APAR = par_array[i];
-
-    ## update the temperature dependent photosynthesis
-    Photosynthesis.photosynthesis_TD!(c3_set, leaf_3, envir);
-    Photosynthesis.photosynthesis_TD!(c4_set, leaf_4, envir);
-
-    ## update the CO₂ dependent photosynthesis
-    photosynthesis_PD!(c3_set, leaf_3, leaf_3.p_i);
-    photosynthesis_PD!(c4_set, leaf_4, leaf_4.p_i);
-
-    ac_3[i], aj_3[i], ap_3[i], ag_3[i], an_3[i] = leaf_3.Ac, leaf_3.Aj, leaf_3.Ap, leaf_3.Ag, leaf_3.An;
-    ac_4[i], aj_4[i], ap_4[i], ag_4[i], an_4[i] = leaf_4.Ac, leaf_4.Aj, leaf_4.Ap, leaf_4.Ag, leaf_4.An;
-end
-
-## plot the CO₂ responses for C3 and C4 photosynthesis
-figure(figsize=(10,6), dpi=100);
-tight_layout(true);
-subplot(1,2,1);
-plot(par_array, ac_3, "r:", lw=2, label="Ac");
-plot(par_array, aj_3, "b:", lw=2, label="Aj");
-plot(par_array, ap_3, "g:", lw=2, label="Ap");
-plot(par_array, ag_3, "k-", lw=1, label="Ag");
-plot(par_array, an_3, "k:", lw=1, label="An");
-xlabel("Absorbed PAR (μmol m⁻² s⁻¹)"       , fontsize=16);
-ylabel("Photosynthetic Rate (μmol m⁻² s⁻¹)", fontsize=16);
-legend(loc="lower right")
-subplot(1,2,2);
-plot(par_array, ac_4, "r:", lw=2, label="Ac");
-plot(par_array, aj_4, "b:", lw=2, label="Aj");
-plot(par_array, ap_4, "g:", lw=2, label="Ap");
-plot(par_array, ag_4, "k-", lw=1, label="Ag");
-plot(par_array, an_4, "k:", lw=1, label="An");
-xlabel("Absorbed PAR (μmol m⁻² s⁻¹)"       , fontsize=16);
-legend(loc="lower right")
-gcf()
-#----------------------------------------------------------------------------
-
-# ## $A$ ~ $T$
-
-## set the internal CO₂ to 30 Pa and temperature to 298.15 K and PAR to 1500
-leaf_3.p_i=30; leaf_3.T=298.15; leaf_3.APAR=1500;
-leaf_4.p_i=30; leaf_4.T=298.15; leaf_4.APAR=1500;
-
-## set an array of APAR
-t_array = collect(FT, 10:50) .+ FT(273.15);
-ac_3 = similar(t_array); aj_3 = similar(t_array); ap_3 = similar(t_array); ag_3 = similar(t_array); an_3 = similar(t_array);
-ac_4 = similar(t_array); aj_4 = similar(t_array); ap_4 = similar(t_array); ag_4 = similar(t_array); an_4 = similar(t_array);
-
-for i in eachindex(t_array);
-    leaf_3.T = t_array[i];
-    leaf_4.T = t_array[i];
-
-    ## update the temperature dependent photosynthesis
-    Photosynthesis.photosynthesis_TD!(c3_set, leaf_3, envir);
-    Photosynthesis.photosynthesis_TD!(c4_set, leaf_4, envir);
-
-    ## update the CO₂ dependent photosynthesis
-    photosynthesis_PD!(c3_set, leaf_3, leaf_3.p_i);
-    photosynthesis_PD!(c4_set, leaf_4, leaf_4.p_i);
-
-    ac_3[i], aj_3[i], ap_3[i], ag_3[i], an_3[i] = leaf_3.Ac, leaf_3.Aj, leaf_3.Ap, leaf_3.Ag, leaf_3.An;
-    ac_4[i], aj_4[i], ap_4[i], ag_4[i], an_4[i] = leaf_4.Ac, leaf_4.Aj, leaf_4.Ap, leaf_4.Ag, leaf_4.An;
-end
-
-## plot the CO₂ responses for C3 and C4 photosynthesis
-figure(figsize=(10,6), dpi=100);
-tight_layout(true);
-subplot(1,2,1);
-plot(t_array, ac_3, "r:", lw=2, label="Ac");
-plot(t_array, aj_3, "b:", lw=2, label="Aj");
-plot(t_array, ap_3, "g:", lw=2, label="Ap");
-plot(t_array, ag_3, "k-", lw=1, label="Ag");
-plot(t_array, an_3, "k:", lw=1, label="An");
-xlabel("Temperature (K)"                   , fontsize=16);
-ylabel("Photosynthetic Rate (μmol m⁻² s⁻¹)", fontsize=16);
-legend(loc="upper left")
-subplot(1,2,2);
-plot(t_array, ac_4, "r:", lw=2, label="Ac");
-plot(t_array, aj_4, "b:", lw=2, label="Aj");
-plot(t_array, ap_4, "g:", lw=2, label="Ap");
-plot(t_array, ag_4, "k-", lw=1, label="Ag");
-plot(t_array, an_4, "k:", lw=1, label="An");
-xlabel("Temperature (K)"                   , fontsize=16);
-legend(loc="upper left")
-gcf()
-#----------------------------------------------------------------------------
diff --git a/docs/src/tutorial_scripts/Photosynthesis/4_stomata.jl b/docs/src/tutorial_scripts/Photosynthesis/4_stomata.jl
deleted file mode 100644
index 0efe5e26..00000000
--- a/docs/src/tutorial_scripts/Photosynthesis/4_stomata.jl
+++ /dev/null
@@ -1,197 +0,0 @@
-# # Stomatal conductance
-# 
-# Here, we will go one step further and look at the entire leaf-level response to different environmental conditions, including the impact of stomatal responses to the environment here.
-# 
-# ## Empirical Stomatal Conductance models
-# 
-# Currently, we can choose between the widely used Ball-Berry model[^1] or the Medlyn approach[^2]. 
-# 
-# Ball and Berry derived the following empirical formulation based on leaf level data (RH is relative humidity):
-# 
-# $$g_{s,w} = g_0 + g_1  \frac{A_n \cdot RH}{C_s}$$
-# 
-# Medlyn derived the following equations based on stomatal optimization theory but in a similar form as the BB model:
-# 
-# $$g_{s,w} = g_0 + \left(1 + \frac{g_1}{\sqrt{VPD}}\right) \frac{A_n}{C_s}$$
-# 
-# Both models are proportional to $A_n$ and inversely proportional to $C_s$, with the main difference in the dependence on either relative humidity in the Ball-Berry model vs. vapor pressure deficit (VPD) in Medlyn et al. In both cases, $g_0$ is the residual conductivity even if stomata are fully closed and $g_1$ is related to the marginal water cost of plant carbon gain. Importantly, $g_1$ can't be inter-changed between the formulations, underlining again that parameters have to be optimized with respect to the model that is eventually being used. 
-# 
-# ## Stomatal Optimization Theories
-# 
-# The empirical formulations only hold in well-watered soil and our main goal is to implement stomatal optimization models to take the entire soil-plant-atmosphere continuum into account[^3]. Here, we will just use the empirical models and steady-state photosynthesis to show the underlying principles.
-# 
-# [^1]: Ball, J.T., Woodrow, I.E. and Berry, J.A., 1987. A model predicting stomatal conductance and its contribution to the control of photosynthesis under different environmental conditions. In Progress in photosynthesis research (pp. 221-224). Springer, Dordrecht.
-# 
-# [^2]: Medlyn, B.E., Duursma, R.A., Eamus, D., Ellsworth, D.S., Prentice, I.C., Barton, C.V., Crous, K.Y., De Angelis, P., Freeman, M. and Wingate, L., 2011. Reconciling the optimal and empirical approaches to modelling stomatal conductance. Global Change Biology, 17(6), pp.2134-2144.
-# 
-# [^3]: Wang, Y., Sperry, J.S., Anderegg, W.R., Venturas, M.D. and Trugman, A.T., 2020. A theoretical and empirical assessment of stomatal optimization modeling. New Phytologist.
-# 
-
-## add usual tools
-using BenchmarkTools
-using PyPlot
-
-## load photosynthesis modules
-using Land.WaterPhysics
-using Land.Photosynthesis
-using Land.Plant
-
-## specify floating type
-FT = Float32;
-#----------------------------------------------------------------------------
-
-## define default photosynthesis parameter sets
-c3_set = C3CLM(FT);
-c4_set = C4CLM(FT);
-
-## define leaf photosynthetic parameters and environmental conditions
-leaf_3 = LeafPhotoContainer{FT}(APAR=1200, Vcmax25=60, Jmax25=120, Vpmax25=80, Rd25=1);
-leaf_4 = LeafPhotoContainer{FT}(APAR=1200, Vcmax25=60, Jmax25=120, Vpmax25=80, Rd25=1);
-envir  = EnvironmentConditions{FT}();
-
-## create empirical stomatal scheme
-sto_c3 = ESMBallBerry{FT}(g1 = 20)
-sto_c4 = ESMBallBerry{FT}(g1 = 4)
-#----------------------------------------------------------------------------
-
-# ## Stomatal response to CO₂
-
-## set the internal CO₂ to 30 Pa and temperature to 298.15 K and PAR to 1500
-leaf_3.p_i=30; leaf_3.T=298.15; leaf_3.APAR=1500;
-leaf_4.p_i=30; leaf_4.T=298.15; leaf_4.APAR=1500;
-
-## set an array of internal CO₂
-p_array = collect(FT, 5:200);
-an_3 = similar(p_array); gs_3 = similar(p_array); pi_3 = similar(p_array);
-an_4 = similar(p_array); gs_4 = similar(p_array); pi_4 = similar(p_array);
-
-for i in eachindex(p_array)
-    envir.p_a = p_array[i];
-    get_empirical_gsw_pi(c3_set, leaf_3, envir, sto_c3);
-    get_empirical_gsw_pi(c4_set, leaf_4, envir, sto_c4);
-    an_3[i], gs_3[i], pi_3[i] = leaf_3.An, leaf_3.g_sw, leaf_3.p_i
-    an_4[i], gs_4[i], pi_4[i] = leaf_4.An, leaf_4.g_sw, leaf_4.p_i
-end
-
-## plot the results
-figure(figsize=(12,3.5), dpi=100)
-tight_layout(true)
-subplot(1,3,1)
-plot(p_array, an_3, label="C3")
-plot(p_array, an_4, label="C4")
-xlabel("Leaf internal CO₂ (Pa)", fontsize=12)
-ylabel("Anet (μmol m⁻² s⁻¹)"   , fontsize=12)
-legend()
-subplot(1,3,2)
-plot(p_array, gs_3, label="C3")
-plot(p_array, gs_4, label="C4")
-xlabel("Leaf internal CO₂ (Pa)"            , fontsize=12)
-ylabel("Stomatal conductance (mol m⁻² s⁻¹)", fontsize=12)
-legend()
-subplot(1,3,3)
-plot(p_array, pi_3 ./ p_array, label="C3")
-plot(p_array, pi_4 ./ p_array, label="C4")
-xlabel("Leaf internal CO₂ (Pa)", fontsize=12)
-ylabel("Cc/Ca"                 , fontsize=12)
-legend()
-gcf()
-#----------------------------------------------------------------------------
-
-# ## Stomatal response to PAR
-
-## set the internal CO₂ to 30 Pa and temperature to 298.15 K and PAR to 1500
-leaf_3.p_i=30; leaf_3.T=298.15; leaf_3.APAR=1500;
-leaf_4.p_i=30; leaf_4.T=298.15; leaf_4.APAR=1500;
-envir  = EnvironmentConditions{FT}();
-
-## set an array of internal CO₂
-par_array = collect(FT, 0:10:2000);
-an_3 = similar(par_array); gs_3 = similar(par_array); pi_3 = similar(par_array);
-an_4 = similar(par_array); gs_4 = similar(par_array); pi_4 = similar(par_array);
-
-for i in eachindex(par_array)
-    leaf_3.APAR = par_array[i];
-    leaf_4.APAR = par_array[i];
-    get_empirical_gsw_pi(c3_set, leaf_3, envir, sto_c3);
-    get_empirical_gsw_pi(c4_set, leaf_4, envir, sto_c4);
-    an_3[i], gs_3[i], pi_3[i] = leaf_3.An, leaf_3.g_sw, leaf_3.p_i
-    an_4[i], gs_4[i], pi_4[i] = leaf_4.An, leaf_4.g_sw, leaf_4.p_i
-end
-
-## plot the results
-figure(figsize=(12,3.5), dpi=100)
-tight_layout(true)
-subplot(1,3,1)
-plot(par_array, an_3, label="C3")
-plot(par_array, an_4, label="C4")
-xlabel("PAR (μmol m⁻² s⁻¹)" , fontsize=12)
-ylabel("Anet (μmol m⁻² s⁻¹)", fontsize=12)
-legend()
-subplot(1,3,2)
-plot(par_array, gs_3, label="C3")
-plot(par_array, gs_4, label="C4")
-xlabel("PAR (μmol m⁻² s⁻¹)"                , fontsize=12)
-ylabel("Stomatal conductance (mol m⁻² s⁻¹)", fontsize=12)
-legend()
-subplot(1,3,3)
-plot(par_array, pi_3 ./ envir.p_a, label="C3")
-plot(par_array, pi_4 ./ envir.p_a, label="C4")
-xlabel("PAR (μmol m⁻² s⁻¹)", fontsize=12)
-ylabel("Cc/Ca"             , fontsize=12)
-legend()
-gcf()
-#----------------------------------------------------------------------------
-
-# ## Stomatal response to Temperature
-
-## set the internal CO₂ to 30 Pa and temperature to 298.15 K and PAR to 1500
-leaf_3.p_i=30; leaf_3.T=298.15; leaf_3.APAR=1500;
-leaf_4.p_i=30; leaf_4.T=298.15; leaf_4.APAR=1500;
-envir  = EnvironmentConditions{FT}();
-
-## set an array of internal CO₂
-t_array = collect(FT, 280:320);
-an_3 = similar(t_array); gs_3 = similar(t_array); pi_3 = similar(t_array);
-an_4 = similar(t_array); gs_4 = similar(t_array); pi_4 = similar(t_array);
-
-for i in eachindex(t_array)
-    leaf_3.T = t_array[i];
-    leaf_4.T = t_array[i];
-    envir.p_H₂O = saturation_vapor_pressure(t_array[i]) * 0.5;
-    get_empirical_gsw_pi(c3_set, leaf_3, envir, sto_c3);
-    get_empirical_gsw_pi(c4_set, leaf_4, envir, sto_c4);
-    an_3[i], gs_3[i], pi_3[i] = leaf_3.An, leaf_3.g_sw, leaf_3.p_i
-    an_4[i], gs_4[i], pi_4[i] = leaf_4.An, leaf_4.g_sw, leaf_4.p_i
-end
-
-## plot the results
-t_array .-= FT(273.15)
-
-figure(figsize=(12,3.5), dpi=100)
-tight_layout(true)
-subplot(1,3,1)
-plot(t_array, an_3, label="C3")
-plot(t_array, an_4, label="C4")
-xlabel("Temperature (K)"    , fontsize=12)
-ylabel("Anet (μmol m⁻² s⁻¹)", fontsize=12)
-legend()
-subplot(1,3,2)
-plot(t_array, gs_3, label="C3")
-plot(t_array, gs_4, label="C4")
-xlabel("Temperature (K)"                   , fontsize=12)
-ylabel("Stomatal conductance (mol m⁻² s⁻¹)", fontsize=12)
-legend()
-subplot(1,3,3)
-plot(t_array, pi_3 ./ envir.p_a, label="C3")
-plot(t_array, pi_4 ./ envir.p_a, label="C4")
-xlabel("Temperature (K)", fontsize=12)
-ylabel("Cc/Ca"          , fontsize=12)
-legend()
-gcf()
-#----------------------------------------------------------------------------
-
-
-
-
-##@btime get_empirical_gsw_pi(c3_set, leaf_3, envir, sto_c3);
-##@btime get_empirical_gsw_pi(c4_set, leaf_4, envir, sto_c4);
diff --git a/docs/src/tutorial_scripts/RAMI_benchmarking_example.jl b/docs/src/tutorial_scripts/RAMI_benchmarking_example.jl
deleted file mode 100644
index 35ef2757..00000000
--- a/docs/src/tutorial_scripts/RAMI_benchmarking_example.jl
+++ /dev/null
@@ -1,810 +0,0 @@
-# # # RAMI Benchmarking 
-#  The goal of the RAMI4PILPS experiment[^1] is to evaluate different approaches by which Land Surface Models in larger Earth System Models quantify the radiation transfer within vegetation canopies. The RAMI4PILPS can be interpreted as a quality control mechanism used to: 
-# 
-# 1) quantify the errors in the radiative transfer scheme;
-# 
-# 2) identify the impact that structural and spectral sub-grid variability may have on radiative transfer; and 
-# 
-# 3) verify the conservation of energy at the level of the surface, as well as inconsistencies arising from different levels of assumptions/simplifications. 
-# 
-# This approach involves direct comparison with reference solutions obtained from highly accurate 3D models identified during the third phase of the RAMI benchmarking exercise[^2]. 
-# 
-# A set of 3D experiments compares the partitioning of incident solar energy into an absorbed (A) flux, a transmitted (T) flux component and the surface reflectance (R). The overall canopy structure for these test cases is reminiscent of open forest canopies with randomly oriented foliage, confined to spherical volumes located at varying heights above the ground.
-# In here, we use a total of 36 test cases including various canopy density, soil brightness, and illumination conditions for the visible (VIS) (400-700nm) and near infra-red (NIR) (700-3000nm) spectral ranges. 
-# 
-#  [^1]: J.L. Widlowski, B. Pinty, M. Clerici, Y. Dai, M. De Kauwe, K. de Ridder, A. Kallel, H. Kobayashi, T. Lavergne, W. Ni-Meister, A. Olchev, T. Quaife, S. Wang, W. Yang, Y. Yang, and H. Yuan (2011), RAMI4PILPS: An intercomparison of formulations for the partitioning of solar radiation in land surface models, Journal of Geophysical Research, 116, G02019, 25, DOI: 10.1029/2010JG001511.
-#  
-#  [^2]: Widlowski, J-L., M. Taberner, B. Pinty, V. Bruniquel-Pinel, M. Disney, R. Fernandes, J.-P. Gastellu-Etchegorry, N. Gobron, A. Kuusk, T. Lavergne, S. Leblanc, P. Lewis, E. Martin, M. Mottus, P. J. R. North, W. Qin, M.Robustelli, N. Rochdi, R.Ruiloba, C.Soler, R.Thompson, W. Verhoef, M. M.Verstraete, and D. Xie (2007), 'The third RAdiation transfer Model Intercomparison (RAMI) exercise: Documenting progress in canopy reflectance modelling', Journal of Geophysical Research, 112, D09111, 28, DOI: 10.1029/2006JD007821. 
-# 
-
-
-#### Use Julia Plots package and switch to plotly js option:
-using PyPlot
-
-##----------------------------------------------------------------------------
-
-## First, we include Revise (good for debugging) and Parameters (tools for structures)
-
-##using Revise
-using Parameters
-##----------------------------------------------------------------------------
-
-## Now include the Land modules
-
-using Land
-using Land.CanopyRT
-##----------------------------------------------------------------------------
-
-##Defining all reference values for the Sparse case 
-
-#----------------------------------------------------------------------------
-
-const FT = Float32
-
-wl_set = create_wl_para_set(FT)
-leaf = create_leaf_bio(FT, wl_set.nwl, wl_set.nWlE, wl_set.nWlF);
-canopy_rt = Canopy4RT{FT, 20, 3.0}()
-canRad_rt = CanopyRadiation{FT, wl_set.nwl, wl_set.nWlF, length(canopy_rt.litab), length(canopy_rt.lazitab), canopy_rt.nlayers}()
-canOpt_rt = create_canopy_optical(FT, wl_set.nwl, canopy_rt.nlayers, length(canopy_rt.lazitab), length(canopy_rt.litab); using_marray=false)
-sunRad_rt = create_incoming_radiation(FT, wl_set.swl);
-
-soil = SoilOpti{FT}(wl_set.wl, FT(0.2)*ones(FT, length(wl_set.wl)), FT[0.1], FT(290.0))
-angles = SolarAngles{FT}()
-
-arrayOfLeaves = [create_leaf_bio(FT, wl_set.nwl, wl_set.nWlE, wl_set.nWlF) for i in 1:canopy_rt.nlayers]
-for i in 1:canopy_rt.nlayers
-    fluspect!(arrayOfLeaves[i], wl_set)
-end
-
-#----------------------------------------------------------------------------
-
-RAMI_SZA = [27.,60.,83.]
-
-RAMI_fabsRed_050_BLK =  [0.09380509999999999, 0.16259713, 0.53931207]
-RAMI_frefRed_050_BLK =  [0.00330673, 0.00517598, 0.01626682]
-RAMI_ftranRed_050_BLK =  [0.90288817, 0.83222689, 0.44442110999999995]
-
-RAMI_fabsRed_050_MED =  [0.10897124, 0.17760124000000002, 0.54764719]
-RAMI_frefRed_050_MED =  [0.09759354, 0.09107608, 0.06177913]
-RAMI_ftranRed_050_MED =  [0.90337609, 0.83265704, 0.44469279]
-
-RAMI_fabsRed_050_SNW =  [0.21471034, 0.28200132, 0.60564705]
-RAMI_frefRed_050_SNW =  [0.7526521700000001, 0.6879087300000001, 0.37825442000000004]
-RAMI_ftranRed_050_SNW =  [0.90659694, 0.83583194, 0.44718138]
-#----------------------------------------------------------------------------
-
-function RAMI_case(LAI, soil_albedo, clumping_index)
-
-  soil.albedo_SW[:] .=soil_albedo;
-  ##Clumping index
-  canopy_rt.Ω = 1.0
-  ##Viewing Zenith Angle in degrees
-  angles.tto=0.0
-  ##Leaf Area index
-  canopy_rt.LAI=LAI
-
-  reflRed_SZA = []
-  absRed_SZA = []
-  transRed_SZA = []
-
-  for SZA=0.0:1:85
-    angles.tts=SZA  
-
-    fluspect!(leaf, wl_set);
-    compute_canopy_geometry!(canopy_rt, angles, canOpt_rt)
-    compute_canopy_matrices!(arrayOfLeaves, canOpt_rt);
-
-   ## leaf reflectance RED
-   leaf.ρ_SW[28] = 0.0735
-   ## leaf transmittance
-   leaf.τ_SW[28]= 0.0566 
-    
-    ##Setting all diffuse to zero
-    sunRad_rt.E_diffuse[28] = 0.0
-    
-    simulate_short_wave!(canopy_rt, canOpt_rt, canRad_rt, sunRad_rt, soil);
-    push!(reflRed_SZA, canRad_rt.alb_direct[28])
-    push!(absRed_SZA, (sum(canRad_rt.netSW_shade,dims=2)[28,1].+sum(canRad_rt.netSW_sunlit,dims=2)[28,1])./(sunRad_rt.E_diffuse[28].+sunRad_rt.E_direct[28]))
-    push!(transRed_SZA,  (canOpt_rt.Es_[28,end] .+ canRad_rt.E_down[28,end])./(sunRad_rt.E_diffuse[28].+sunRad_rt.E_direct[28]))
-  end
-
-  ######## Clumped Case
-
-  reflRed_clump_SZA = []
-  absRed_clump_SZA = []
-  transRed_clump_SZA = []
-
-
-  ##Clumping index
-  canopy_rt.Ω = clumping_index
-
-  for SZA=0.0:1:85
-    angles.tts=SZA  
-
-    fluspect!(leaf, wl_set);
-    compute_canopy_geometry!(canopy_rt, angles, canOpt_rt)
-    compute_canopy_matrices!(arrayOfLeaves, canOpt_rt);
-    
-    simulate_short_wave!(canopy_rt, canOpt_rt, canRad_rt, sunRad_rt, soil);
-    push!(reflRed_clump_SZA, canRad_rt.alb_direct[28])
-    push!(absRed_clump_SZA, (sum(canRad_rt.netSW_shade,dims=2)[28,1].+sum(canRad_rt.netSW_sunlit,dims=2)[28,1])./(sunRad_rt.E_diffuse[28].+sunRad_rt.E_direct[28]))
-    push!(transRed_clump_SZA,  (canOpt_rt.Es_[28,end] .+ canRad_rt.E_down[28,end])./(sunRad_rt.E_diffuse[28].+sunRad_rt.E_direct[28]))
-
-  end
-    
-  return reflRed_SZA,absRed_SZA,transRed_SZA,reflRed_clump_SZA,absRed_clump_SZA,transRed_clump_SZA
-    
-end;
-
-#----------------------------------------------------------------------------
-
-
-#TODO nest those into a loop!
-
-##Sparse case with black soil
-reflRed_SZA,absRed_SZA,transRed_SZA,reflRed_clump_SZA,absRed_clump_SZA,transRed_clump_SZA=RAMI_case(0.50265, 0.0, 0.365864235);
-
-#----------------------------------------------------------------------------
-
-SZA=0:1:85
-
-figure(figsize=(10,5))
-
-subplot(1,2,1)
-plot(SZA, reflRed_SZA,label=["reflectance"])
-plot(SZA, absRed_SZA ,label=["absorptance"])
-plot(SZA, transRed_SZA,label=["transmittance"])
-scatter(RAMI_SZA, RAMI_frefRed_050_BLK)
-scatter(RAMI_SZA, RAMI_fabsRed_050_BLK)
-scatter(RAMI_SZA, RAMI_ftranRed_050_BLK)
-title("050_BLK - Default")
-ylabel("Radiation Partitioning")
-xlabel("Sun Zenith Angle")
-xlim(0.0, 90.)
-ylim(-0.05, 1.0)
-xticks(0:20:91.)
-yticks(0:0.2:1.0)
-
-subplot(1,2,2)
-plot(SZA, reflRed_clump_SZA,label=["reflectance"])
-plot(SZA, absRed_clump_SZA ,label=["absorptance"])
-plot(SZA,transRed_clump_SZA,label=["transmittance"])
-scatter(RAMI_SZA, RAMI_frefRed_050_BLK,label="RAMI reflectance")
-scatter(RAMI_SZA, RAMI_fabsRed_050_BLK,label="RAMI absorptance")
-scatter(RAMI_SZA, RAMI_ftranRed_050_BLK,label="RAMI transmittance")
-title("Clumping")
-ylabel("Radiation Partitioning")
-xlabel("Sun Zenith Angle")
-xlim(0.0, 90.)
-ylim(-0.05, 1.0)
-xticks(0:20:91.)
-yticks(0:0.2:1.0)
-
-legend()
-gcf()
-
-#----------------------------------------------------------------------------
-
-##Sparse case with medium soil
-reflRed_SZA,absRed_SZA,transRed_SZA,reflRed_clump_SZA,absRed_clump_SZA,transRed_clump_SZA=RAMI_case(0.50265, 0.1217, 0.365864235);
-
-#----------------------------------------------------------------------------
-
-SZA=0:1:85
-
-figure(figsize=(10,5))
-
-subplot(1,2,1)
-plot(SZA, reflRed_SZA,label=["reflectance"])
-plot(SZA, absRed_SZA ,label=["absorptance"])
-plot(SZA, transRed_SZA,label=["transmittance"])
-scatter(RAMI_SZA, RAMI_frefRed_050_MED)
-scatter(RAMI_SZA, RAMI_fabsRed_050_MED)
-scatter(RAMI_SZA, RAMI_ftranRed_050_MED)
-title("050_MED - Default")
-ylabel("Radiation Partitioning")
-xlabel("Sun Zenith Angle")
-xlim(0.0, 90.)
-ylim(-0.05, 1.0)
-xticks(0:20:91.)
-yticks(0:0.2:1.0)
-
-subplot(1,2,2)
-plot(SZA, reflRed_clump_SZA,label=["reflectance"])
-plot(SZA, absRed_clump_SZA ,label=["absorptance"])
-plot(SZA,transRed_clump_SZA,label=["transmittance"])
-scatter(RAMI_SZA, RAMI_frefRed_050_MED,label="RAMI reflectance")
-scatter(RAMI_SZA, RAMI_fabsRed_050_MED,label="RAMI absorptance")
-scatter(RAMI_SZA, RAMI_ftranRed_050_MED,label="RAMI transmittance")
-title("Clumping")
-ylabel("Radiation Partitioning")
-xlabel("Sun Zenith Angle")
-xlim(0.0, 90.)
-ylim(-0.05, 1.0)
-xticks(0:20:91.)
-yticks(0:0.2:1.0)
-
-legend()
-gcf()
-
-#----------------------------------------------------------------------------
-
-##Sparse case with snowy soil
-reflRed_SZA,absRed_SZA,transRed_SZA,reflRed_clump_SZA,absRed_clump_SZA,transRed_clump_SZA=RAMI_case(0.50265, 0.9640, 0.365864235);
-
-#----------------------------------------------------------------------------
-
-SZA=0:1:85
-
-figure(figsize=(10,5))
-
-subplot(1,2,1)
-plot(SZA, reflRed_SZA,label=["reflectance"])
-plot(SZA, absRed_SZA ,label=["absorptance"])
-plot(SZA, transRed_SZA,label=["transmittance"])
-scatter(RAMI_SZA, RAMI_frefRed_050_SNW)
-scatter(RAMI_SZA, RAMI_fabsRed_050_SNW)
-scatter(RAMI_SZA, RAMI_ftranRed_050_SNW)
-title("050_SNW - Default")
-ylabel("Radiation Partitioning")
-xlabel("Sun Zenith Angle")
-xlim(0.0, 90.)
-ylim(-0.05, 1.0)
-xticks(0:20:91.)
-yticks(0:0.2:1.0)
-
-subplot(1,2,2)
-plot(SZA, reflRed_clump_SZA,label=["reflectance"])
-plot(SZA, absRed_clump_SZA ,label=["absorptance"])
-plot(SZA,transRed_clump_SZA,label=["transmittance"])
-scatter(RAMI_SZA, RAMI_frefRed_050_SNW,label="RAMI reflectance")
-scatter(RAMI_SZA, RAMI_fabsRed_050_SNW,label="RAMI absorptance")
-scatter(RAMI_SZA, RAMI_ftranRed_050_SNW,label="RAMI transmittance")
-title("Clumping")
-ylabel("Radiation Partitioning")
-xlabel("Sun Zenith Angle")
-xlim(0.0, 90.)
-ylim(-0.05, 1.0)
-xticks(0:20:91.)
-yticks(0:0.2:1.0)
-
-legend()
-gcf()
-
-#----------------------------------------------------------------------------
-
-##Defining all reference values for the Medium case 
-
-RAMI_SZA = [27.,60.,83.]
-
-
-RAMI_fabsRed_150_BLK =  [0.28137804, 0.46514268999999997, 0.89063486]
-RAMI_frefRed_150_BLK =  [0.00923676, 0.01379672, 0.02970703]
-RAMI_ftranRed_150_BLK =  [0.7093851999999999, 0.52106059, 0.07965811]
-
-RAMI_fabsRed_150_MED =  [0.31403827, 0.49003033, 0.89432051]
-RAMI_frefRed_150_MED =  [0.06195053, 0.05151941, 0.03561715]
-RAMI_ftranRed_150_MED =  [0.7104761399999999, 0.52197456, 0.07977039000000001]
-
-RAMI_fabsRed_150_SNW =  [0.5431621799999999, 0.66519762, 0.9201217300000001]
-RAMI_frefRed_150_SNW =  [0.43100610000000006, 0.31581022999999997, 0.07698033]
-RAMI_ftranRed_150_SNW =  [0.71754777, 0.52755972, 0.08049832999999999]
-#----------------------------------------------------------------------------
-
-##Medium case with black soil
-reflRed_SZA,absRed_SZA,transRed_SZA,reflRed_clump_SZA,absRed_clump_SZA,transRed_clump_SZA=RAMI_case(1.5017, 0.0, 0.405417644);
-
-#----------------------------------------------------------------------------
-
-SZA=0:1:85
-
-figure(figsize=(10,5))
-
-subplot(1,2,1)
-plot(SZA, reflRed_SZA,label=["reflectance"])
-plot(SZA, absRed_SZA ,label=["absorptance"])
-plot(SZA, transRed_SZA,label=["transmittance"])
-scatter(RAMI_SZA, RAMI_frefRed_150_BLK)
-scatter(RAMI_SZA, RAMI_fabsRed_150_BLK)
-scatter(RAMI_SZA, RAMI_ftranRed_150_BLK)
-title("150_BLK - Default")
-ylabel("Radiation Partitioning")
-xlabel("Sun Zenith Angle")
-xlim(0.0, 90.)
-ylim(-0.05, 1.0)
-xticks(0:20:91.)
-yticks(0:0.2:1.0)
-
-subplot(1,2,2)
-plot(SZA, reflRed_clump_SZA,label=["reflectance"])
-plot(SZA, absRed_clump_SZA ,label=["absorptance"])
-plot(SZA,transRed_clump_SZA,label=["transmittance"])
-scatter(RAMI_SZA, RAMI_frefRed_150_BLK,label="RAMI reflectance")
-scatter(RAMI_SZA, RAMI_fabsRed_150_BLK,label="RAMI absorptance")
-scatter(RAMI_SZA, RAMI_ftranRed_150_BLK,label="RAMI transmittance")
-title("Clumping")
-ylabel("Radiation Partitioning")
-xlabel("Sun Zenith Angle")
-xlim(0.0, 90.)
-ylim(-0.05, 1.0)
-xticks(0:20:91.)
-yticks(0:0.2:1.0)
-
-legend()
-gcf()
-
-#----------------------------------------------------------------------------
-
-##Medium case with medium soil
-reflRed_SZA,absRed_SZA,transRed_SZA,reflRed_clump_SZA,absRed_clump_SZA,transRed_clump_SZA=RAMI_case(1.5017, 0.1217, 0.405417644);
-
-#----------------------------------------------------------------------------
-
-SZA=0:1:85
-
-figure(figsize=(10,5))
-
-subplot(1,2,1)
-plot(SZA, reflRed_SZA,label=["reflectance"])
-plot(SZA, absRed_SZA ,label=["absorptance"])
-plot(SZA, transRed_SZA,label=["transmittance"])
-scatter(RAMI_SZA, RAMI_frefRed_150_MED)
-scatter(RAMI_SZA, RAMI_fabsRed_150_MED)
-scatter(RAMI_SZA, RAMI_ftranRed_150_MED)
-title("150_MED - Default")
-ylabel("Radiation Partitioning")
-xlabel("Sun Zenith Angle")
-xlim(0.0, 90.)
-ylim(-0.05, 1.0)
-xticks(0:20:91.)
-yticks(0:0.2:1.0)
-
-subplot(1,2,2)
-plot(SZA, reflRed_clump_SZA,label=["reflectance"])
-plot(SZA, absRed_clump_SZA ,label=["absorptance"])
-plot(SZA,transRed_clump_SZA,label=["transmittance"])
-scatter(RAMI_SZA, RAMI_frefRed_150_MED,label="RAMI reflectance")
-scatter(RAMI_SZA, RAMI_fabsRed_150_MED,label="RAMI absorptance")
-scatter(RAMI_SZA, RAMI_ftranRed_150_MED,label="RAMI transmittance")
-title("Clumping")
-ylabel("Radiation Partitioning")
-xlabel("Sun Zenith Angle")
-xlim(0.0, 90.)
-ylim(-0.05, 1.0)
-xticks(0:20:91.)
-yticks(0:0.2:1.0)
-
-legend()
-gcf()
-
-#----------------------------------------------------------------------------
-
-##Medium case with black soil
-reflRed_SZA,absRed_SZA,transRed_SZA,reflRed_clump_SZA,absRed_clump_SZA,transRed_clump_SZA=RAMI_case(1.5017, 0.9640, 0.405417644);
-
-#----------------------------------------------------------------------------
-
-SZA=0:1:85
-
-figure(figsize=(10,5))
-
-subplot(1,2,1)
-plot(SZA, reflRed_SZA,label=["reflectance"])
-plot(SZA, absRed_SZA ,label=["absorptance"])
-plot(SZA, transRed_SZA,label=["transmittance"])
-scatter(RAMI_SZA, RAMI_frefRed_150_SNW)
-scatter(RAMI_SZA, RAMI_fabsRed_150_SNW)
-scatter(RAMI_SZA, RAMI_ftranRed_150_SNW)
-title("150_SNW - Default")
-ylabel("Radiation Partitioning")
-xlabel("Sun Zenith Angle")
-xlim(0.0, 90.)
-ylim(-0.05, 1.0)
-xticks(0:20:91.)
-yticks(0:0.2:1.0)
-
-subplot(1,2,2)
-plot(SZA, reflRed_clump_SZA,label=["reflectance"])
-plot(SZA, absRed_clump_SZA ,label=["absorptance"])
-plot(SZA,transRed_clump_SZA,label=["transmittance"])
-scatter(RAMI_SZA, RAMI_frefRed_150_SNW,label="RAMI reflectance")
-scatter(RAMI_SZA, RAMI_fabsRed_150_SNW,label="RAMI absorptance")
-scatter(RAMI_SZA, RAMI_ftranRed_150_SNW,label="RAMI transmittance")
-title("Clumping")
-ylabel("Radiation Partitioning")
-xlabel("Sun Zenith Angle")
-xlim(0.0, 90.)
-ylim(-0.05, 1.0)
-xticks(0:20:91.)
-yticks(0:0.2:1.0)
-
-legend()
-gcf()
-
-#----------------------------------------------------------------------------
-
-##Defining all reference values for the Dense case 
-
-RAMI_SZA = [27.,60.,83.]
-
-
-RAMI_fabsRed_250_BLK =  [0.46852539, 0.70426097, 0.9461774300000001]
-RAMI_frefRed_250_BLK =  [0.01445858, 0.02016963, 0.03477486]
-RAMI_ftranRed_250_BLK =  [0.51701603, 0.2755694, 0.01904771]
-
-RAMI_fabsRed_250_MED =  [0.50540545, 0.72429659, 0.94742381]
-RAMI_frefRed_250_MED =  [0.03953053, 0.03315039, 0.03580858]
-RAMI_ftranRed_250_MED =  [0.51811911, 0.27616192, 0.01909098]
-
-RAMI_fabsRed_250_SNW =  [0.76512258, 0.86538802, 0.9562473199999999]
-RAMI_frefRed_250_SNW =  [0.21595537, 0.124503, 0.043056080000000004]
-RAMI_ftranRed_250_SNW =  [0.5256125, 0.280805, 0.01935]
-#----------------------------------------------------------------------------
-
-##Dense case with black soil
-reflRed_SZA,absRed_SZA,transRed_SZA,reflRed_clump_SZA,absRed_clump_SZA,transRed_clump_SZA=RAMI_case(2.5007, 0.0, 0.45946608);
-
-#----------------------------------------------------------------------------
-
-SZA=0:1:85
-
-figure(figsize=(10,5))
-
-subplot(1,2,1)
-plot(SZA, reflRed_SZA,label=["reflectance"])
-plot(SZA, absRed_SZA ,label=["absorptance"])
-plot(SZA, transRed_SZA,label=["transmittance"])
-scatter(RAMI_SZA, RAMI_frefRed_250_BLK)
-scatter(RAMI_SZA, RAMI_fabsRed_250_BLK)
-scatter(RAMI_SZA, RAMI_ftranRed_250_BLK)
-title("250_BLK - Default")
-ylabel("Radiation Partitioning")
-xlabel("Sun Zenith Angle")
-xlim(0.0, 90.)
-ylim(-0.05, 1.0)
-xticks(0:20:91.)
-yticks(0:0.2:1.0)
-
-subplot(1,2,2)
-plot(SZA, reflRed_clump_SZA,label=["reflectance"])
-plot(SZA, absRed_clump_SZA ,label=["absorptance"])
-plot(SZA,transRed_clump_SZA,label=["transmittance"])
-scatter(RAMI_SZA, RAMI_frefRed_250_BLK,label="RAMI reflectance")
-scatter(RAMI_SZA, RAMI_fabsRed_250_BLK,label="RAMI absorptance")
-scatter(RAMI_SZA, RAMI_ftranRed_250_BLK,label="RAMI transmittance")
-title("Clumping")
-ylabel("Radiation Partitioning")
-xlabel("Sun Zenith Angle")
-xlim(0.0, 90.)
-ylim(-0.05, 1.0)
-xticks(0:20:91.)
-yticks(0:0.2:1.0)
-
-legend()
-gcf()
-
-#----------------------------------------------------------------------------
-
-##Medium case with medium soil
-reflRed_SZA,absRed_SZA,transRed_SZA,reflRed_clump_SZA,absRed_clump_SZA,transRed_clump_SZA=RAMI_case(2.5007, 0.1217, 0.45946608);
-
-#----------------------------------------------------------------------------
-
-SZA=0:1:85
-
-figure(figsize=(10,5))
-
-subplot(1,2,1)
-plot(SZA, reflRed_SZA,label=["reflectance"])
-plot(SZA, absRed_SZA ,label=["absorptance"])
-plot(SZA, transRed_SZA,label=["transmittance"])
-scatter(RAMI_SZA, RAMI_frefRed_250_MED)
-scatter(RAMI_SZA, RAMI_fabsRed_250_MED)
-scatter(RAMI_SZA, RAMI_ftranRed_250_MED)
-title("250_MED - Default")
-ylabel("Radiation Partitioning")
-xlabel("Sun Zenith Angle")
-xlim(0.0, 90.)
-ylim(-0.05, 1.0)
-xticks(0:20:91.)
-yticks(0:0.2:1.0)
-
-subplot(1,2,2)
-plot(SZA, reflRed_clump_SZA,label=["reflectance"])
-plot(SZA, absRed_clump_SZA ,label=["absorptance"])
-plot(SZA,transRed_clump_SZA,label=["transmittance"])
-scatter(RAMI_SZA, RAMI_frefRed_250_MED,label="RAMI reflectance")
-scatter(RAMI_SZA, RAMI_fabsRed_250_MED,label="RAMI absorptance")
-scatter(RAMI_SZA, RAMI_ftranRed_250_MED,label="RAMI transmittance")
-title("Clumping")
-ylabel("Radiation Partitioning")
-xlabel("Sun Zenith Angle")
-xlim(0.0, 90.)
-ylim(-0.05, 1.0)
-xticks(0:20:91.)
-yticks(0:0.2:1.0)
-
-legend()
-gcf()
-
-#----------------------------------------------------------------------------
-
-##Dense case with snowy soil
-reflRed_SZA,absRed_SZA,transRed_SZA,reflRed_clump_SZA,absRed_clump_SZA,transRed_clump_SZA=RAMI_case(2.5007, 0.9640, 0.45946608);
-
-#----------------------------------------------------------------------------
-
-SZA=0:1:85
-
-figure(figsize=(10,5))
-
-subplot(1,2,1)
-plot(SZA, reflRed_SZA,label=["reflectance"])
-plot(SZA, absRed_SZA ,label=["absorptance"])
-plot(SZA, transRed_SZA,label=["transmittance"])
-scatter(RAMI_SZA, RAMI_frefRed_250_SNW)
-scatter(RAMI_SZA, RAMI_fabsRed_250_SNW)
-scatter(RAMI_SZA, RAMI_ftranRed_250_SNW)
-title("250_SNW - Default")
-ylabel("Radiation Partitioning")
-xlabel("Sun Zenith Angle")
-xlim(0.0, 90.)
-ylim(-0.05, 1.0)
-xticks(0:20:91.)
-yticks(0:0.2:1.0)
-
-subplot(1,2,2)
-plot(SZA, reflRed_clump_SZA,label=["reflectance"])
-plot(SZA, absRed_clump_SZA ,label=["absorptance"])
-plot(SZA,transRed_clump_SZA,label=["transmittance"])
-scatter(RAMI_SZA, RAMI_frefRed_250_SNW,label="RAMI reflectance")
-scatter(RAMI_SZA, RAMI_fabsRed_250_SNW,label="RAMI absorptance")
-scatter(RAMI_SZA, RAMI_ftranRed_250_SNW,label="RAMI transmittance")
-title("Clumping")
-ylabel("Radiation Partitioning")
-xlabel("Sun Zenith Angle")
-xlim(0.0, 90.)
-ylim(-0.05, 1.0)
-xticks(0:20:91.)
-yticks(0:0.2:1.0)
-
-legend()
-gcf()
-
-#----------------------------------------------------------------------------
-
-# # ### Test a VZA dependence in the principal plane with clumping
-
-## Define a few wavelengths:
-wl_blue = 450.0;
-wl_red = 600.0;
-wl_FarRed = 740.0;
-wl_Red = 685.0;
-ind_wle_blue  = argmin(abs.(wl_set.wle .-wl_blue));
-ind_wle_red = argmin(abs.(wl_set.wle .-wl_red));
-ind_wlf_FR  = argmin(abs.(wl_set.wlf .-wl_FarRed));
-ind_wlf_R  = argmin(abs.(wl_set.wlf .-wl_Red));
-ind_red = argmin(abs.(wl_set.wl .-wl_Red));
-ind_NIR = argmin(abs.(wl_set.wl .-800));
-
-#----------------------------------------------------------------------------
-
-SIF_FR = Float32[]
-SIF_R = Float32[]
-reflVIS = Float32[]
-reflNIR = Float32[]
-
-#### Just running the code over all geometries:
-##MED
-soil.albedo_SW[:] .=0.1217;
-#### Set sun SZA to 27 degrees
-angles.tts=27.
-#### Set 0 azimuth (principal plane)
-angles.psi=0
-
-##Adding clumping 
-canopy_rt.Ω = 1.0
-#### LAI of 3:
-canopy_rt.LAI = 2.5007
-#### Define VZA 
-VZA=collect(-89.5:0.5:89.5)
-
-for VZA_ in VZA
-    angles.tto=VZA_
-    compute_canopy_geometry!(canopy_rt, angles, canOpt_rt)
-    compute_canopy_matrices!(arrayOfLeaves, canOpt_rt);
-    simulate_short_wave!(canopy_rt, canOpt_rt, canRad_rt, sunRad_rt, soil);
-    computeSIF_Fluxes!(arrayOfLeaves, canOpt_rt, canRad_rt, canopy_rt, soil, wl_set);
-    #### Handpicked indices in 
-    push!(reflVIS, canRad_rt.alb_obs[ind_red])
-    push!(reflNIR, canRad_rt.alb_obs[ind_NIR])
-    push!(SIF_R , canRad_rt.SIF_obs[ind_wlf_R])
-    push!(SIF_FR, canRad_rt.SIF_obs[ind_wlf_FR ])
-end
-
-
-##Adding clumping 
-canopy_rt.Ω = 0.45946608
-
-SIF_FR_clump = Float32[]
-SIF_R_clump = Float32[]
-reflVIS_clump = Float32[]
-reflNIR_clump = Float32[]
-
-
-for VZA_ in VZA
-    angles.tto=VZA_
-    compute_canopy_geometry!(canopy_rt, angles, canOpt_rt)
-    compute_canopy_matrices!(arrayOfLeaves, canOpt_rt);
-    simulate_short_wave!(canopy_rt, canOpt_rt, canRad_rt, sunRad_rt, soil);
-    computeSIF_Fluxes!(arrayOfLeaves, canOpt_rt, canRad_rt, canopy_rt, soil, wl_set);
-    #### Handpicked indices in 
-    push!(reflVIS_clump, canRad_rt.alb_obs[ind_red])
-    push!(reflNIR_clump, canRad_rt.alb_obs[ind_NIR])
-    push!(SIF_R_clump , canRad_rt.SIF_obs[ind_wlf_R])
-    push!(SIF_FR_clump, canRad_rt.SIF_obs[ind_wlf_FR ])
-end
-#----------------------------------------------------------------------------
-
-#### Plots Visible 
-figure()
-plot(VZA, reflVIS, color=:black,label="Red Reflectance", lw=2)
-plot(VZA, SIF_R/30, color=:orange,label="Red SIF (/30)", lw=2)
-plot(VZA, reflVIS_clump, color=:black, ls="--", lw=2,label="Red Reflectance w/ Clumping")
-plot(VZA, SIF_R_clump/30, color=:orange, ls="--", lw=2,label="Red SIF (/30) w/ Clumping")
-xlabel("Viewing Zenith Angle")
-legend()
-gcf()
-#----------------------------------------------------------------------------
-
-#### Plots Visible 
-figure()
-plot(VZA, reflNIR, color=:black,label="NIR Reflectance", lw=2)
-plot(VZA, SIF_FR/6, color=:orange,label="Far Red SIF (/6)", lw=2)
-plot(VZA, reflNIR_clump, color=:black, ls="--", lw=2,label="NIR Reflectance w/ Clumping")
-plot(VZA, SIF_FR_clump/6, color=:orange, ls="--", lw=2,label="Far Red SIF (/6) w/ Clumping")
-xlabel("Viewing Zenith Angle")
-legend()
-gcf()
-#----------------------------------------------------------------------------
-
-# # ## BRDF sampling
-# 
-# By going through viewing and azimuth angles, we can construct a full BRDF for reflectance and SIF emissions at different wavelengths:
-# 
-
-reflVIS = Float32[]
-reflNIR = Float32[]
-SIF_FR = Float32[]
-SIF_R  = Float32[]
-
-##MED
-soil.albedo_SW[:] .=0.1217;
-angles.tts=27.
-angles.psi=0
-canopy_rt.LAI=2.5007
-canopy_rt.Ω = 1.0
-for psi=0:360
-    angles.psi=psi
-    for VZA=0:1:85
-        angles.tto=VZA
-
-        compute_canopy_geometry!(canopy_rt, angles, canOpt_rt)
-        compute_canopy_matrices!(arrayOfLeaves, canOpt_rt);
-        simulate_short_wave!(canopy_rt, canOpt_rt, canRad_rt, sunRad_rt, soil);
-        computeSIF_Fluxes!(arrayOfLeaves, canOpt_rt, canRad_rt, canopy_rt, soil, wl_set);
-        push!(reflVIS, canRad_rt.alb_obs[28])
-        push!(reflNIR, canRad_rt.alb_obs[52])
-        push!(SIF_R , canRad_rt.SIF_obs[8])
-        push!(SIF_FR, canRad_rt.SIF_obs[20])
-    end
-end
-
-##Adding clumping 
-canopy_rt.Ω = 0.45946608
-
-SIF_FR_clump = Float32[]
-SIF_R_clump = Float32[]
-reflVIS_clump = Float32[]
-reflNIR_clump = Float32[]
-
-for psi=0:360
-    angles.psi=psi
-    for VZA=0:1:85
-        angles.tto=VZA
-
-        compute_canopy_geometry!(canopy_rt, angles, canOpt_rt)
-        compute_canopy_matrices!(arrayOfLeaves, canOpt_rt);
-        simulate_short_wave!(canopy_rt, canOpt_rt, canRad_rt, sunRad_rt, soil);
-        computeSIF_Fluxes!(arrayOfLeaves, canOpt_rt, canRad_rt, canopy_rt, soil, wl_set);
-        push!(reflVIS_clump, canRad_rt.alb_obs[28])
-        push!(reflNIR_clump, canRad_rt.alb_obs[52])
-        push!(SIF_R_clump , canRad_rt.SIF_obs[8])
-        push!(SIF_FR_clump, canRad_rt.SIF_obs[20])
-    end
-end
-
-
-#----------------------------------------------------------------------------
-
-A = reshape(reflNIR, ( 86,361));
-B = reshape(reflVIS, ( 86,361));
-SIFFER = reshape(SIF_R, ( 86,361));
-SIFFER_FR = reshape(SIF_FR, ( 86,361));
-
-A_clump = reshape(reflNIR_clump, ( 86,361));
-B_clump = reshape(reflVIS_clump, ( 86,361));
-SIFFER_clump = reshape(SIF_R_clump, ( 86,361));
-SIFFER_FR_clump = reshape(SIF_FR_clump, ( 86,361));
-#----------------------------------------------------------------------------
-
-figure(figsize=(10,5))
-subplot(1,2,1, polar=true)
-grid(false)
-hm = contourf(deg2rad.(collect((0:360))),collect(0:1:85),  A,  cmap=:viridis, levels=collect(0.25:0.012:0.5))
-title("NIR reflectance BRDF")
-yticks([])
-colorbar()
-subplot(1,2,2, polar=true)
-grid(false)
-hm = contourf(deg2rad.(collect((0:360))),collect(0:1:85),  A_clump,  cmap=:viridis, levels=collect(0.25:0.012:0.5))
-title("Clumping")
-yticks([])
-colorbar()
-gcf()
-
-#----------------------------------------------------------------------------
-
-figure(figsize=(10,5))
-subplot(1,2,1, polar=true)
-grid(false)
-hm = contourf(deg2rad.(collect((0:360))),collect(0:1:85),  B,  cmap=:viridis, levels=collect(0.0:0.005:0.045))
-title("Red reflectance BRDF")
-yticks([])
-colorbar()
-subplot(1,2,2, polar=true)
-grid(false)
-hm = contourf(deg2rad.(collect((0:360))),collect(0:1:85),  B_clump,  cmap=:viridis, levels=collect(0.0:0.005:0.045))
-title("Clumping")
-yticks([])
-colorbar()
-gcf()
-
-#----------------------------------------------------------------------------
-
-figure(figsize=(10,5))
-subplot(1,2,1, polar=true)
-grid(false)
-hm = contourf(deg2rad.(collect((0:360))),collect(0:1:85),  SIFFER,  cmap=:viridis, levels=collect(0.3:0.05:0.8))
-title("Red SIF emission BRDF")
-yticks([])
-colorbar()
-subplot(1,2,2, polar=true)
-grid(false)
-hm = contourf(deg2rad.(collect((0:360))),collect(0:1:85),  SIFFER_clump,  cmap=:viridis, levels=collect(0.3:0.05:0.8))
-title("Clumping")
-yticks([])
-colorbar()
-gcf()
-
-
-#----------------------------------------------------------------------------
-
-figure(figsize=(10,5))
-subplot(1,2,1, polar=true)
-grid(false)
-hm = contourf(deg2rad.(collect((0:360))),collect(0:1:85),  SIFFER_FR,  cmap=:viridis, levels=collect(1.:0.1:3.5))
-title("Far-Red SIF emission BRDF")
-yticks([])
-colorbar()
-subplot(1,2,2, polar=true)
-grid(false)
-hm = contourf(deg2rad.(collect((0:360))),collect(0:1:85),  SIFFER_FR_clump,  cmap=:viridis, levels=collect(1.:0.1:3.5))
-title("Clumping")
-yticks([])
-colorbar()
-gcf()
-
-
-
-#----------------------------------------------------------------------------
diff --git a/docs/src/tutorial_scripts/Radiation_Test_BRDF.jl b/docs/src/tutorial_scripts/Radiation_Test_BRDF.jl
deleted file mode 100644
index 0d9e5951..00000000
--- a/docs/src/tutorial_scripts/Radiation_Test_BRDF.jl
+++ /dev/null
@@ -1,314 +0,0 @@
-
-# # Canopy Radiative Transfer Example #1
-# This example will go through the calculations of hemispheric and bidirectional reflectance as well as emission of Solar Induced Chlorophyll Fluorescence (SIF). The sun sensor geometry is defined by the solar zenith angle SZA, the viewing zenith angle VZA (observer, 0degrees=Nadir looking) and the relative azimuth angle between the sun and observer (0 or 180degrees denoting the principal plane). 
-# 
-
-## Use Julia Plots package and switch to plotly js option:
-using PyPlot
-
-#----------------------------------------------------------------------------
-
-# First, we include Revise (good for debugging) and Parameters (tools for structures)
-
-#using Revise
-using Parameters
-#----------------------------------------------------------------------------
-
-# Now include the Land modules
-
-using Land
-using Land.CanopyRT
-#----------------------------------------------------------------------------
-
-# and unpack some of the mostly used variables or structure (same as writing CanopyRT.leafbio)
-
-#@unpack FT, leafbio, canopy, angles, canOpt, canRad,sunRad,soil, wl, wle, wlf = CanopyRT
-#----------------------------------------------------------------------------
-
-# This extracted a number of structures, which are loaded with default values at startup:
-# * *leafbio* includes all leaf pigment concentrations, such as Chlorophyll, leaf water, Carotenoids and dry matter content. (mutable struct leafbio)
-# * *canopy* includes Canopy properties such as LAI, leaf inclination distribution, clumping factor (mutable struct struct_canopy)
-# * *angles* includes SZA, VZA and azimuth (mutable struct struct_angles)
-# * *canOpt* saves a variety of canopy optical properties to be computed (mutable struct struct_canopyOptProps)
-# * *canRad* includes radiation computed within the Canopy RT module (mutable struct struct_canopyRadiation)
-# * *sunRad* provides incoming direct and diffuse incoming solar radiation (mutable struct incomingRadiation)
-# * *soil* provides soil albedo and skin temperature
-# 
-# as well as some arrays:
-# * *wl* is the wavelength grid (nm) for the solar radiation computation
-# * *wle* is the wavelength grid in the photosynthetically active range (a subset of wl, used to define fluorescence excitation and driving photosynthesis)
-# * *wlf* is the wavelength grid for SIF (subset of wl). The fluorescence excitation matrices are defined on the basis of wle and wlf.
-
-# Let us just define our own leaf here, we can construct it using standard values but need to provide all dimensions (will be fixed as variables are saved in MArrays):
-
-const FT = Float32
-
-wl_set = create_wl_para_set(FT)
-leaf = create_leaf_bio(FT, wl_set.nwl, wl_set.nWlE, wl_set.nWlF);
-canopy_rt = Canopy4RT{FT, 20, 3.0}()
-canRad_rt = CanopyRadiation{FT, wl_set.nwl, wl_set.nWlF, length(canopy_rt.litab), length(canopy_rt.lazitab), canopy_rt.nlayers}()
-canOpt_rt = create_canopy_optical(FT, wl_set.nwl, canopy_rt.nlayers, length(canopy_rt.lazitab), length(canopy_rt.litab); using_marray=false)
-sunRad_rt = create_incoming_radiation(FT, wl_set.swl);
-
-## show leaf Chlorophyll content:
-@show leaf.Cab
-#----------------------------------------------------------------------------
-
-# ---
-# ## Leaf Optical Properties
-# 
-# Now we can first run fluspect, which is an extension of the Prospect leaf optical properties program and includes computations of the fluorescence emission responses as well. CanopyRT.optis includes all pigment absorption cross sections as well as refractive index of water to compute leaf optical properties. 
-# For details, see:
-# 
-# Féret, J.B., Gitelson, A.A., Noble, S.D. and Jacquemoud, S., 2017. PROSPECT-D: Towards modeling leaf optical properties through a complete lifecycle. Remote Sensing of Environment, 193, pp.204-215.
-# 
-# Van der Tol, C., Verhoef, W., Timmermans, J., Verhoef, A. and Su, Z., 2009. An integrated model of soil-canopy spectral radiances, photosynthesis, fluorescence, temperature and energy balance. Biogeosciences, 6(12).
-# 
-# Vilfan, N., Van der Tol, C., Muller, O., Rascher, U. and Verhoef, W., 2016. Fluspect-B: A model for leaf fluorescence, reflectance and transmittance spectra. Remote sensing of environment, 186, pp.596-615.
-
-## Run Fluspect:
-fluspect!(leaf, wl_set);
-#----------------------------------------------------------------------------
-
-# #### Fluorescence excitation matrices
-# Now we can visualize the fluorescence excitatiom matrices, which determine how absorbed photons at a specific wavelength *wle* incident on the leaf are emitted backwards (in relation to the incident light but hemispherically diffuse here) or forward. Here, we ignore contributions from Photosystem I and just use a fixed shape as input at the chloroplast level for Photosystem II, hence all spectral shapes are determined by the light distribution within the leaf. Several effects can be observed in the plots below: The first SIF peak at 680nm is much weaker in the forward direction than in the backward direction as more the re-absorption within the leaf is much higher for the forward direction. Similarly, blue incident light penetrates the leaf less than at higher wavelengths, so the chlorophyll re-absorption (backwards) is less re-absorbed by chlorophyll as it emanates from less deep layers. 
-# 
-
-## Plot Mb matrix
-figure()
-contourf(wl_set.wle, wl_set.wlf, leaf.Mb)
-xlabel("Excitation wavelength (nm)")
-ylabel("Emission wavelength (nm)")
-title("Fluorescence backward (refl) emission (Mb)")
-gcf()
-#----------------------------------------------------------------------------
-
-## Plot Mf matrix
-figure()
-contourf(wl_set.wle, wl_set.wlf, leaf.Mf)
-xlabel("Excitation wavelength (nm)")
-ylabel("Emission wavelength (nm)")
-title("Fluorescence forward (transmission) emission (Mf)")
-gcf()
-#----------------------------------------------------------------------------
-
-## Define a few wavelengths:
-wl_blue = 450.0;
-wl_red = 600.0;
-wl_FarRed = 740.0;
-wl_Red = 685.0;
-ind_wle_blue  = argmin(abs.(wl_set.wle .-wl_blue));
-ind_wle_red = argmin(abs.(wl_set.wle .-wl_red));
-ind_wlf_FR  = argmin(abs.(wl_set.wlf .-wl_FarRed));
-ind_wlf_R  = argmin(abs.(wl_set.wlf .-wl_Red));
-ind_red = argmin(abs.(wl_set.wl .-wl_Red));
-ind_NIR = argmin(abs.(wl_set.wl .-800));
-
-#----------------------------------------------------------------------------
-
-## Plot some cross section in wle and wlf space:
-figure()
-plot(wl_set.wlf,leaf.Mf[:,ind_wle_blue], color=:black, lw = 2 , label="Forward SIF, excited at $wl_blue nm")
-plot(wl_set.wlf,leaf.Mb[:,ind_wle_blue],color=:orange, lw = 2 , label="Backward SIF, excited at $wl_blue nm" )
-plot(wl_set.wlf,leaf.Mf[:,ind_wle_red], color=:black,ls="--",lw=2, label="Forward SIF, excited at $wl_red nm" )
-plot(wl_set.wlf,leaf.Mb[:,ind_wle_red], color=:orange,ls="--",lw=2, label="Backward SIF, excited at $wl_red nm" )
-xlabel("Wavelength (nm)")
-ylabel("Fluorescence")
-legend()
-gcf()
-#----------------------------------------------------------------------------
-
-## Plot some cross section in wle and wlf space:
-figure()
-plot(wl_set.wle,leaf.Mf[ind_wlf_FR,:], color=:black, lw = 2 , label="Forward SIF, emitted at $wl_FarRed nm")
-plot(wl_set.wle,leaf.Mb[ind_wlf_FR,:],color=:orange, lw = 2 , label="Backward SIF, emitted at $wl_FarRed nm" )
-plot(wl_set.wle,leaf.Mf[ind_wlf_R,:], color=:black,ls="--",lw=2, label="Forward SIF, emitted at $wl_Red nm" )
-plot(wl_set.wle,leaf.Mb[ind_wlf_R,:], color=:orange,ls="--",lw=2, label="Backward SIF, emitted at $wl_Red nm" )
-xlabel("Absorbed Wavelength (nm)")
-ylabel("Fluorescence")
-legend()
-gcf()
-#----------------------------------------------------------------------------
-
-# ---
-# ### Leaf reflectance and transmission 
-# Within Fluspect, leaf reflectance and transmission is calculated (this part is actually identical to what PROSPECT is doing and much less involved than the Fluorescence part). The model basically uses a doubling adding routine to solve for the radiative transfer within the leaf using constituent absorption cross sections and constituent abundances in the leaf (assuming vertically homogenous distribution).
-# 
-# Here, we just create another leaf with different concentrations to show the impact on leaf reflectance and transmission due to changes in chlorophyll content and liquid water content (mostly in the two liquid water absorption bands at 1400 and 1900nm).
-
-## Let's create a leaf with a different Cab and Cw (water) content (<span style="color:red">Try changing other pigment contents, plot leaf reflectance and transmissions and explain where (spectrally) and why reflectance and transmission changes</span>):
-leaf_2 = create_leaf_bio(FT, wl_set.nwl, wl_set.nWlE, wl_set.nWlF);
-leaf_2.Cab = 80
-leaf_2.Cw = 0.012
-## show leaf Chlorophyll content:
-## and Run Fluspect:
-fluspect!(leaf_2, wl_set);
-#----------------------------------------------------------------------------
-
-figure()
-plot(wl_set.wl,1 .-leaf.τ_SW, color=:black, lw = 2 , label="Leaf Transmission")
-plot(wl_set.wl,leaf.ρ_SW,color=:orange, lw = 2 , label="Leaf Reflectance" )
-plot(wl_set.wl,1 .-leaf_2.τ_SW, color=:black, ls="--",lw=2, label="Leaf ##2 Transmission")
-plot(wl_set.wl,leaf_2.ρ_SW,color=:orange, ls="--",lw=2, label="Leaf ##2 Reflectance" )
-xlabel("Wavelength (nm)")
-legend()
-gcf()
-#----------------------------------------------------------------------------
-
-# ---
-# ## Moving from the leaf to the entire canopy
-# 
-# Our model here is based on mSCOPE[^1] and we can prescribe different leaf optical properties within a complex canopy. At the moment, the leaf angular distribution is the same vertically (but could be changed in the future).
-# 
-# [^1]: Yang, P., Verhoef, W. and van der Tol, C., 2017. The mSCOPE model: A simple adaptation to the SCOPE model to describe reflectance, fluorescence and photosynthesis of vertically heterogeneous canopies. Remote sensing of environment, 201, pp.1-11.
-# 
-
-## This is to be changed later but at the moment, we need to generate an Array of leaves, basically for each layer of the canopy 
-
-arrayOfLeaves = [create_leaf_bio(FT, wl_set.nwl, wl_set.nWlE, wl_set.nWlF) for i in 1:canopy_rt.nlayers]
-for i in 1:canopy_rt.nlayers
-    fluspect!(arrayOfLeaves[i],  wl_set)
-end
-#----------------------------------------------------------------------------
-
-# ### Basic Steps for Canopy RT:
-# Below are the basic steps for the canopy radiative transfer (SIF fluxes are dependent on stress levels at each leaf but here we use a standard SIF yield for now):
-
-## Set Soil albedo to 0.2
-soil = SoilOpti{FT}(wl_set.wl, FT(0.2)*ones(FT, length(wl_set.wl)), FT[0.1], FT(290.0))
-angles = SolarAngles{FT}()
-
-## Compute Canopyoptical properties dependend on sun-sensor and leaf angle distributions:
-compute_canopy_geometry!(canopy_rt, angles, canOpt_rt)
-## Compute RT matrices with leaf reflectance and transmissions folded in:
-compute_canopy_matrices!(arrayOfLeaves, canOpt_rt);
-## Perform SW radiation transfer:
-simulate_short_wave!(canopy_rt, canOpt_rt, canRad_rt, sunRad_rt, soil);
-## Compute outgoing SIF flux (using constant fluorescence efficiency at the chloroplast level)
-derive_canopy_fluxes!(canopy_rt, canOpt_rt, canRad_rt, sunRad_rt, soil, arrayOfLeaves, wl_set);
-#----------------------------------------------------------------------------
-
-# ### Test a VZA dependence in the principal plane
-
-
-SIF_FR = Float32[]
-SIF_R = Float32[]
-reflVIS = Float32[]
-reflNIR = Float32[]
-
-## Just running the code over all geometries:
-
-## Set sun SZA to 30 degrees
-angles.tts=30
-## Set 0 azimuth (principal plane)
-angles.psi=0
-## LAI of 3:
-canopy_rt.LAI = 3
-## Define VZA 
-VZA=collect(-89.5:0.5:89.5)
-
-for VZA_ in VZA
-    angles.tto=VZA_
-    compute_canopy_geometry!(canopy_rt, angles, canOpt_rt)
-    compute_canopy_matrices!(arrayOfLeaves, canOpt_rt);
-    simulate_short_wave!(canopy_rt, canOpt_rt, canRad_rt, sunRad_rt, soil);
-    computeSIF_Fluxes!(arrayOfLeaves, canOpt_rt, canRad_rt, canopy_rt, soil, wl_set);
-    ## Handpicked indices in 
-    push!(reflVIS, canRad_rt.alb_obs[ind_red])
-    push!(reflNIR, canRad_rt.alb_obs[ind_NIR])
-    push!(SIF_R , canRad_rt.SIF_obs[ind_wlf_R])
-    push!(SIF_FR, canRad_rt.SIF_obs[ind_wlf_FR ])
-end
-#----------------------------------------------------------------------------
-
-## Plots Visible 
-figure()
-plot(VZA, reflVIS, label="Red Reflectance", lw=2)
-plot(VZA, SIF_R/30, label="Red SIF (/30)", lw=2)
-xlabel("Viewing Zenith Angle")
-legend()
-gcf()
-#----------------------------------------------------------------------------
-
-## Plot Near Infrared:
-figure()
-plot(VZA, reflNIR, label="NIR Reflectance", lw=2)
-plot(VZA, SIF_FR/6, label="Far Red SIF (/6)", lw=2)
-xlabel("Viewing Zenith Angle")
-gcf()
-#----------------------------------------------------------------------------
-
-# ---
-# ## BRDF sampling
-# By going through viewing and azimuth angles, we can construct a full BRDF for reflectance and SIF emissions at different wavelengths:
-
-reflVIS = Float32[]
-reflNIR = Float32[]
-SIF_FR = Float32[]
-SIF_R  = Float32[]
-angles.tts=48
-angles.psi=0
-canopy_rt.LAI=3.22
-for psi=0:360
-    angles.psi=psi
-    for VZA=0:1:85
-        angles.tto=VZA
-
-        compute_canopy_geometry!(canopy_rt, angles, canOpt_rt)
-        compute_canopy_matrices!(arrayOfLeaves, canOpt_rt);
-        simulate_short_wave!(canopy_rt, canOpt_rt, canRad_rt, sunRad_rt, soil);
-        computeSIF_Fluxes!(arrayOfLeaves, canOpt_rt, canRad_rt, canopy_rt, soil, wl_set);
-        push!(reflVIS, canRad_rt.alb_obs[28])
-        push!(reflNIR, canRad_rt.alb_obs[52])
-        push!(SIF_R , canRad_rt.SIF_obs[8])
-        push!(SIF_FR, canRad_rt.SIF_obs[20])
-    end
-end
-#----------------------------------------------------------------------------
-
-A = reshape(reflNIR, ( 86,361));
-B = reshape(reflVIS, ( 86,361));
-SIFFER = reshape(SIF_R, ( 86,361));
-SIFFER_FR = reshape(SIF_FR, ( 86,361));
-#----------------------------------------------------------------------------
-
-##heatmap(A, cmap=)
-figure()
-subplot(1,1,1, polar=true)
-grid(false)
-hm = contourf(deg2rad.(collect((0:360))),collect(0:1:85),  A,  cmap=:viridis)
-title("NIR reflectance BRDF")
-colorbar()
-gcf()
-#----------------------------------------------------------------------------
-
-##heatmap(A, cmap=)
-figure()
-subplot(1,1,1, polar=true)
-grid(false)
-hm = contourf(deg2rad.(collect((0:360))),collect(0:1:85),  B,  cmap=:viridis)
-title("VIS reflectance BRDF")
-colorbar()
-gcf()
-#----------------------------------------------------------------------------
-
-figure()
-subplot(1,1,1, polar=true)
-grid(false)
-hm = contourf(deg2rad.(collect((0:360))),collect(0:1:85),  SIFFER, cmap=:viridis)
-title("Red SIF emission BRDF")
-colorbar()
-gcf()
-#----------------------------------------------------------------------------
-
-figure()
-subplot(1,1,1, polar=true)
-grid(false)
-hm = contourf(deg2rad.(collect((0:360))),collect(0:1:85),  SIFFER_FR, cmap=:viridis)
-title("Far Red SIF emission BRDF")
-colorbar()
-gcf()
-#----------------------------------------------------------------------------
-
-
-#----------------------------------------------------------------------------
diff --git a/examples/Manifest.toml b/examples/Manifest.toml
deleted file mode 100644
index 34beeb84..00000000
--- a/examples/Manifest.toml
+++ /dev/null
@@ -1,567 +0,0 @@
-# This file is machine-generated - editing it directly is not advised
-
-julia_version = "1.8.2"
-manifest_format = "2.0"
-project_hash = "887866b015a80538da3db6a46a9a2be9d325e946"
-
-[[deps.ArgTools]]
-uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
-version = "1.1.1"
-
-[[deps.Artifacts]]
-uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
-
-[[deps.Base64]]
-uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
-
-[[deps.BufferedStreams]]
-git-tree-sha1 = "bb065b14d7f941b8617bc323063dbe79f55d16ea"
-uuid = "e1450e63-4bb3-523b-b2a4-4ffa8c0fd77d"
-version = "1.1.0"
-
-[[deps.CFTime]]
-deps = ["Dates", "Printf"]
-git-tree-sha1 = "ed2e76c1c3c43fd9d0cb9248674620b29d71f2d1"
-uuid = "179af706-886a-5703-950a-314cd64e0468"
-version = "0.1.2"
-
-[[deps.CSV]]
-deps = ["CodecZlib", "Dates", "FilePathsBase", "InlineStrings", "Mmap", "Parsers", "PooledArrays", "SentinelArrays", "Tables", "Unicode", "WeakRefStrings"]
-git-tree-sha1 = "c5fd7cd27ac4aed0acf4b73948f0110ff2a854b2"
-uuid = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
-version = "0.10.7"
-
-[[deps.Calculus]]
-deps = ["LinearAlgebra"]
-git-tree-sha1 = "f641eb0a4f00c343bbc32346e1217b86f3ce9dad"
-uuid = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9"
-version = "0.5.1"
-
-[[deps.ChainRulesCore]]
-deps = ["Compat", "LinearAlgebra", "SparseArrays"]
-git-tree-sha1 = "e7ff6cadf743c098e08fca25c91103ee4303c9bb"
-uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
-version = "1.15.6"
-
-[[deps.ChangesOfVariables]]
-deps = ["ChainRulesCore", "LinearAlgebra", "Test"]
-git-tree-sha1 = "38f7a08f19d8810338d4f5085211c7dfa5d5bdd8"
-uuid = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0"
-version = "0.1.4"
-
-[[deps.CodecZlib]]
-deps = ["TranscodingStreams", "Zlib_jll"]
-git-tree-sha1 = "ded953804d019afa9a3f98981d99b33e3db7b6da"
-uuid = "944b1d66-785c-5afd-91f1-9de20f533193"
-version = "0.7.0"
-
-[[deps.Compat]]
-deps = ["Dates", "LinearAlgebra", "UUIDs"]
-git-tree-sha1 = "3ca828fe1b75fa84b021a7860bd039eaea84d2f2"
-uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
-version = "4.3.0"
-
-[[deps.CompilerSupportLibraries_jll]]
-deps = ["Artifacts", "Libdl"]
-uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
-version = "0.5.2+0"
-
-[[deps.ConstrainedRootSolvers]]
-deps = ["DocStringExtensions", "PkgUtility", "Test", "UnPack"]
-git-tree-sha1 = "26fb23009728099595c4d47c2028f0f9ef161122"
-uuid = "7e2492bd-0955-4089-8696-9df2af57a479"
-version = "0.1.5"
-
-[[deps.Crayons]]
-git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15"
-uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
-version = "4.1.1"
-
-[[deps.DataAPI]]
-git-tree-sha1 = "46d2680e618f8abd007bce0c3026cb0c4a8f2032"
-uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
-version = "1.12.0"
-
-[[deps.DataFrames]]
-deps = ["Compat", "DataAPI", "Future", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrettyTables", "Printf", "REPL", "Random", "Reexport", "SnoopPrecompile", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"]
-git-tree-sha1 = "5b93f1b47eec9b7194814e40542752418546679f"
-uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
-version = "1.4.2"
-
-[[deps.DataStructures]]
-deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
-git-tree-sha1 = "d1fff3a548102f48987a52a2e0d114fa97d730f0"
-uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
-version = "0.18.13"
-
-[[deps.DataValueInterfaces]]
-git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
-uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464"
-version = "1.0.0"
-
-[[deps.Dates]]
-deps = ["Printf"]
-uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
-
-[[deps.DocStringExtensions]]
-deps = ["LibGit2"]
-git-tree-sha1 = "c36550cb29cbe373e95b3f40486b9a4148f89ffd"
-uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
-version = "0.9.2"
-
-[[deps.Downloads]]
-deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"]
-uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
-version = "1.6.0"
-
-[[deps.DualNumbers]]
-deps = ["Calculus", "NaNMath", "SpecialFunctions"]
-git-tree-sha1 = "5837a837389fccf076445fce071c8ddaea35a566"
-uuid = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"
-version = "0.6.8"
-
-[[deps.EmeraldConstants]]
-deps = ["DocStringExtensions", "Test"]
-git-tree-sha1 = "fff28dae7585fbe4c2a7645edb08baca0f800556"
-uuid = "f1e47f7f-56cf-4a63-9b2b-695e95ad7a29"
-version = "0.1.0"
-
-[[deps.FileIO]]
-deps = ["Pkg", "Requires", "UUIDs"]
-git-tree-sha1 = "7be5f99f7d15578798f338f5433b6c432ea8037b"
-uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
-version = "1.16.0"
-
-[[deps.FilePathsBase]]
-deps = ["Compat", "Dates", "Mmap", "Printf", "Test", "UUIDs"]
-git-tree-sha1 = "e27c4ebe80e8699540f2d6c805cc12203b614f12"
-uuid = "48062228-2e41-5def-b9a4-89aafe57970f"
-version = "0.9.20"
-
-[[deps.FileWatching]]
-uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
-
-[[deps.Formatting]]
-deps = ["Printf"]
-git-tree-sha1 = "8339d61043228fdd3eb658d86c926cb282ae72a8"
-uuid = "59287772-0a20-5a39-b81b-1366585eb4c0"
-version = "0.4.2"
-
-[[deps.Future]]
-deps = ["Random"]
-uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"
-
-[[deps.HDF5]]
-deps = ["Compat", "HDF5_jll", "Libdl", "Mmap", "Random", "Requires"]
-git-tree-sha1 = "19effd6b5af759c8aaeb9c77f89422d3f975ab65"
-uuid = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
-version = "0.16.12"
-
-[[deps.HDF5_jll]]
-deps = ["Artifacts", "JLLWrappers", "LibCURL_jll", "Libdl", "OpenSSL_jll", "Pkg", "Zlib_jll"]
-git-tree-sha1 = "4cc2bb72df6ff40b055295fdef6d92955f9dede8"
-uuid = "0234f1f7-429e-5d53-9886-15a909be8d59"
-version = "1.12.2+2"
-
-[[deps.HypergeometricFunctions]]
-deps = ["DualNumbers", "LinearAlgebra", "OpenLibm_jll", "SpecialFunctions", "Test"]
-git-tree-sha1 = "709d864e3ed6e3545230601f94e11ebc65994641"
-uuid = "34004b35-14d8-5ef3-9330-4cdb6864b03a"
-version = "0.3.11"
-
-[[deps.InlineStrings]]
-deps = ["Parsers"]
-git-tree-sha1 = "a62189e59d33e1615feb7a48c0bea7c11e4dc61d"
-uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48"
-version = "1.3.0"
-
-[[deps.InteractiveUtils]]
-deps = ["Markdown"]
-uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
-
-[[deps.InverseFunctions]]
-deps = ["Test"]
-git-tree-sha1 = "49510dfcb407e572524ba94aeae2fced1f3feb0f"
-uuid = "3587e190-3f89-42d0-90ee-14403ec27112"
-version = "0.1.8"
-
-[[deps.InvertedIndices]]
-git-tree-sha1 = "bee5f1ef5bf65df56bdd2e40447590b272a5471f"
-uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f"
-version = "1.1.0"
-
-[[deps.IrrationalConstants]]
-git-tree-sha1 = "7fd44fd4ff43fc60815f8e764c0f352b83c49151"
-uuid = "92d709cd-6900-40b7-9082-c6be49f344b6"
-version = "0.1.1"
-
-[[deps.IteratorInterfaceExtensions]]
-git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856"
-uuid = "82899510-4779-5014-852e-03e436cf321d"
-version = "1.0.0"
-
-[[deps.JLD2]]
-deps = ["FileIO", "MacroTools", "Mmap", "OrderedCollections", "Pkg", "Printf", "Reexport", "TranscodingStreams", "UUIDs"]
-git-tree-sha1 = "1c3ff7416cb727ebf4bab0491a56a296d7b8cf1d"
-uuid = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
-version = "0.4.25"
-
-[[deps.JLLWrappers]]
-deps = ["Preferences"]
-git-tree-sha1 = "abc9885a7ca2052a736a600f7fa66209f96506e1"
-uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
-version = "1.4.1"
-
-[[deps.Land]]
-deps = ["ConstrainedRootSolvers", "DataFrames", "DocStringExtensions", "EmeraldConstants", "HypergeometricFunctions", "LazyArtifacts", "LinearAlgebra", "MAT", "Pkg", "PkgUtility", "QuadGK", "SpecialFunctions", "Statistics", "Test", "TextIO", "UnPack", "WaterPhysics"]
-git-tree-sha1 = "b21ec9a7627ccedcf360b0049fa7c0a5fd16ae1c"
-repo-rev = "v0.1"
-repo-url = "https://github.com/CliMA/Land.git"
-uuid = "27e3c115-2cb8-4114-b7a5-cd9f011f9dcc"
-version = "0.1.0"
-
-[[deps.LazyArtifacts]]
-deps = ["Artifacts", "Pkg"]
-uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
-
-[[deps.LibCURL]]
-deps = ["LibCURL_jll", "MozillaCACerts_jll"]
-uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
-version = "0.6.3"
-
-[[deps.LibCURL_jll]]
-deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
-uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
-version = "7.84.0+0"
-
-[[deps.LibGit2]]
-deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
-uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
-
-[[deps.LibSSH2_jll]]
-deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
-uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
-version = "1.10.2+0"
-
-[[deps.Libdl]]
-uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
-
-[[deps.Libiconv_jll]]
-deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
-git-tree-sha1 = "42b62845d70a619f063a7da093d995ec8e15e778"
-uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531"
-version = "1.16.1+1"
-
-[[deps.LinearAlgebra]]
-deps = ["Libdl", "libblastrampoline_jll"]
-uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
-
-[[deps.LogExpFunctions]]
-deps = ["ChainRulesCore", "ChangesOfVariables", "DocStringExtensions", "InverseFunctions", "IrrationalConstants", "LinearAlgebra"]
-git-tree-sha1 = "94d9c52ca447e23eac0c0f074effbcd38830deb5"
-uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
-version = "0.3.18"
-
-[[deps.Logging]]
-uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
-
-[[deps.MAT]]
-deps = ["BufferedStreams", "CodecZlib", "HDF5", "SparseArrays"]
-git-tree-sha1 = "971be550166fe3f604d28715302b58a3f7293160"
-uuid = "23992714-dd62-5051-b70f-ba57cb901cac"
-version = "0.10.3"
-
-[[deps.MacroTools]]
-deps = ["Markdown", "Random"]
-git-tree-sha1 = "42324d08725e200c23d4dfb549e0d5d89dede2d2"
-uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
-version = "0.5.10"
-
-[[deps.Markdown]]
-deps = ["Base64"]
-uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
-
-[[deps.MbedTLS_jll]]
-deps = ["Artifacts", "Libdl"]
-uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
-version = "2.28.0+0"
-
-[[deps.Missings]]
-deps = ["DataAPI"]
-git-tree-sha1 = "bf210ce90b6c9eed32d25dbcae1ebc565df2687f"
-uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
-version = "1.0.2"
-
-[[deps.Mmap]]
-uuid = "a63ad114-7e13-5084-954f-fe012c677804"
-
-[[deps.MozillaCACerts_jll]]
-uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
-version = "2022.2.1"
-
-[[deps.NCDatasets]]
-deps = ["CFTime", "DataStructures", "Dates", "NetCDF_jll", "NetworkOptions", "Printf"]
-git-tree-sha1 = "1818d54a489492517841c2cb87475ba20918264c"
-uuid = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
-version = "0.12.8"
-
-[[deps.NaNMath]]
-deps = ["OpenLibm_jll"]
-git-tree-sha1 = "a7c3d1da1189a1c2fe843a3bfa04d18d20eb3211"
-uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
-version = "1.0.1"
-
-[[deps.NetCDF_jll]]
-deps = ["Artifacts", "HDF5_jll", "JLLWrappers", "LibCURL_jll", "Libdl", "Pkg", "XML2_jll", "Zlib_jll"]
-git-tree-sha1 = "072f8371f74c3b9e1b26679de7fbf059d45ea221"
-uuid = "7243133f-43d8-5620-bbf4-c2c921802cf3"
-version = "400.902.5+1"
-
-[[deps.NetcdfIO]]
-deps = ["DataFrames", "DocStringExtensions", "NCDatasets", "NetCDF_jll", "Test"]
-git-tree-sha1 = "bbad13bf11d78b9f02ecb4d5a9515a8a0ec762f9"
-uuid = "6a36f34d-89cf-423a-87c4-84549e82f670"
-version = "0.2.5"
-
-[[deps.NetworkOptions]]
-uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
-version = "1.2.0"
-
-[[deps.OpenBLAS_jll]]
-deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"]
-uuid = "4536629a-c528-5b80-bd46-f80d51c5b363"
-version = "0.3.20+0"
-
-[[deps.OpenLibm_jll]]
-deps = ["Artifacts", "Libdl"]
-uuid = "05823500-19ac-5b8b-9628-191a04bc5112"
-version = "0.8.1+0"
-
-[[deps.OpenSSL_jll]]
-deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
-git-tree-sha1 = "e60321e3f2616584ff98f0a4f18d98ae6f89bbb3"
-uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
-version = "1.1.17+0"
-
-[[deps.OpenSpecFun_jll]]
-deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"]
-git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1"
-uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e"
-version = "0.5.5+0"
-
-[[deps.OrderedCollections]]
-git-tree-sha1 = "85f8e6578bf1f9ee0d11e7bb1b1456435479d47c"
-uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
-version = "1.4.1"
-
-[[deps.Parsers]]
-deps = ["Dates"]
-git-tree-sha1 = "6c01a9b494f6d2a9fc180a08b182fcb06f0958a0"
-uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
-version = "2.4.2"
-
-[[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"
-version = "1.8.0"
-
-[[deps.PkgUtility]]
-deps = ["Dates", "LazyArtifacts", "Pkg", "Statistics", "StatsBase", "Test"]
-git-tree-sha1 = "968844493dfb3c8f6cf6f420f07d926508836b5d"
-uuid = "0d262f2c-28e9-492c-8e19-d7a5c4f11611"
-version = "0.2.1"
-
-[[deps.PooledArrays]]
-deps = ["DataAPI", "Future"]
-git-tree-sha1 = "a6062fe4063cdafe78f4a0a81cfffb89721b30e7"
-uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720"
-version = "1.4.2"
-
-[[deps.Preferences]]
-deps = ["TOML"]
-git-tree-sha1 = "47e5f437cc0e7ef2ce8406ce1e7e24d44915f88d"
-uuid = "21216c6a-2e73-6563-6e65-726566657250"
-version = "1.3.0"
-
-[[deps.PrettyTables]]
-deps = ["Crayons", "Formatting", "Markdown", "Reexport", "StringManipulation", "Tables"]
-git-tree-sha1 = "460d9e154365e058c4d886f6f7d6df5ffa1ea80e"
-uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
-version = "2.1.2"
-
-[[deps.Printf]]
-deps = ["Unicode"]
-uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
-
-[[deps.QuadGK]]
-deps = ["DataStructures", "LinearAlgebra"]
-git-tree-sha1 = "97aa253e65b784fd13e83774cadc95b38011d734"
-uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
-version = "2.6.0"
-
-[[deps.REPL]]
-deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
-uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
-
-[[deps.Random]]
-deps = ["SHA", "Serialization"]
-uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
-
-[[deps.Reexport]]
-git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b"
-uuid = "189a3867-3050-52da-a836-e630ba90ab69"
-version = "1.2.2"
-
-[[deps.Requires]]
-deps = ["UUIDs"]
-git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7"
-uuid = "ae029012-a4dd-5104-9daa-d747884805df"
-version = "1.3.0"
-
-[[deps.SHA]]
-uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
-version = "0.7.0"
-
-[[deps.SentinelArrays]]
-deps = ["Dates", "Random"]
-git-tree-sha1 = "efd23b378ea5f2db53a55ae53d3133de4e080aa9"
-uuid = "91c51154-3ec4-41a3-a24f-3f23e20d615c"
-version = "1.3.16"
-
-[[deps.Serialization]]
-uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
-
-[[deps.SnoopPrecompile]]
-git-tree-sha1 = "f604441450a3c0569830946e5b33b78c928e1a85"
-uuid = "66db9d55-30c0-4569-8b51-7e840670fc0c"
-version = "1.0.1"
-
-[[deps.Sockets]]
-uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
-
-[[deps.SortingAlgorithms]]
-deps = ["DataStructures"]
-git-tree-sha1 = "b3363d7460f7d098ca0912c69b082f75625d7508"
-uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c"
-version = "1.0.1"
-
-[[deps.SparseArrays]]
-deps = ["LinearAlgebra", "Random"]
-uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
-
-[[deps.SpecialFunctions]]
-deps = ["ChainRulesCore", "IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"]
-git-tree-sha1 = "d75bda01f8c31ebb72df80a46c88b25d1c79c56d"
-uuid = "276daf66-3868-5448-9aa4-cd146d93841b"
-version = "2.1.7"
-
-[[deps.Statistics]]
-deps = ["LinearAlgebra", "SparseArrays"]
-uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
-
-[[deps.StatsAPI]]
-deps = ["LinearAlgebra"]
-git-tree-sha1 = "f9af7f195fb13589dd2e2d57fdb401717d2eb1f6"
-uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0"
-version = "1.5.0"
-
-[[deps.StatsBase]]
-deps = ["DataAPI", "DataStructures", "LinearAlgebra", "LogExpFunctions", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"]
-git-tree-sha1 = "d1bf48bfcc554a3761a133fe3a9bb01488e06916"
-uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
-version = "0.33.21"
-
-[[deps.StringManipulation]]
-git-tree-sha1 = "46da2434b41f41ac3594ee9816ce5541c6096123"
-uuid = "892a3eda-7b42-436c-8928-eab12a02cf0e"
-version = "0.3.0"
-
-[[deps.TOML]]
-deps = ["Dates"]
-uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
-version = "1.0.0"
-
-[[deps.TableTraits]]
-deps = ["IteratorInterfaceExtensions"]
-git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39"
-uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c"
-version = "1.0.1"
-
-[[deps.Tables]]
-deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits", "Test"]
-git-tree-sha1 = "c79322d36826aa2f4fd8ecfa96ddb47b174ac78d"
-uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
-version = "1.10.0"
-
-[[deps.Tar]]
-deps = ["ArgTools", "SHA"]
-uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
-version = "1.10.1"
-
-[[deps.Test]]
-deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
-uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
-
-[[deps.TextIO]]
-deps = ["CSV", "DataFrames", "Test"]
-git-tree-sha1 = "25418339f316f8f3c9f3c7ba78d574f713c45d5e"
-repo-rev = "wyujie"
-repo-url = "https://github.com/Yujie-W/TextIO.jl"
-uuid = "52be8cd1-7bc6-40f3-9b52-aa7544d4b77d"
-version = "0.1.0"
-
-[[deps.TranscodingStreams]]
-deps = ["Random", "Test"]
-git-tree-sha1 = "8a75929dcd3c38611db2f8d08546decb514fcadf"
-uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
-version = "0.9.9"
-
-[[deps.UUIDs]]
-deps = ["Random", "SHA"]
-uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
-
-[[deps.UnPack]]
-git-tree-sha1 = "387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b"
-uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
-version = "1.0.2"
-
-[[deps.Unicode]]
-uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
-
-[[deps.WaterPhysics]]
-deps = ["DocStringExtensions", "EmeraldConstants", "PkgUtility", "Test", "UnPack"]
-git-tree-sha1 = "2ca56b50c07bb8d6e6c214c8dabafb97cad479bf"
-uuid = "20dd5ee6-61da-454b-ac5d-c09c2977e03a"
-version = "0.1.5"
-
-[[deps.WeakRefStrings]]
-deps = ["DataAPI", "InlineStrings", "Parsers"]
-git-tree-sha1 = "b1be2855ed9ed8eac54e5caff2afcdb442d52c23"
-uuid = "ea10d353-3f73-51f8-a26c-33c1cb351aa5"
-version = "1.4.2"
-
-[[deps.XML2_jll]]
-deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "Zlib_jll"]
-git-tree-sha1 = "58443b63fb7e465a8a7210828c91c08b92132dff"
-uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a"
-version = "2.9.14+0"
-
-[[deps.Zlib_jll]]
-deps = ["Libdl"]
-uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
-version = "1.2.12+3"
-
-[[deps.libblastrampoline_jll]]
-deps = ["Artifacts", "Libdl", "OpenBLAS_jll"]
-uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
-version = "5.1.1+0"
-
-[[deps.nghttp2_jll]]
-deps = ["Artifacts", "Libdl"]
-uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
-version = "1.48.0+0"
-
-[[deps.p7zip_jll]]
-deps = ["Artifacts", "Libdl"]
-uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"
-version = "17.4.0+0"
diff --git a/examples/Project.toml b/examples/Project.toml
index 42989fd4..e6037cff 100644
--- a/examples/Project.toml
+++ b/examples/Project.toml
@@ -5,12 +5,10 @@ JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
 Land = "27e3c115-2cb8-4114-b7a5-cd9f011f9dcc"
 NetcdfIO = "6a36f34d-89cf-423a-87c4-84549e82f670"
 PkgUtility = "0d262f2c-28e9-492c-8e19-d7a5c4f11611"
-TextIO = "52be8cd1-7bc6-40f3-9b52-aa7544d4b77d"
 
 [compat]
 DataFrames = "1.3.6"
 JLD2 = "0.4.23"
-Land = "0.1.0"
 NetcdfIO = "0.2.5"
 PkgUtility = "0.2.0"
 julia = "1.7"
diff --git a/examples/example.jl b/examples/example.jl
index e447d1bf..dd91e2d7 100644
--- a/examples/example.jl
+++ b/examples/example.jl
@@ -1,6 +1,6 @@
 #
 #
-# This file is meant for CliMA Land example
+# This file is meant for CliMA Land v0.1 example
 #
 #
 using DataFrames: DataFrame, DataFrameRow
@@ -363,7 +363,7 @@ function run_model!(spac::SPACMono{FT}, df::DataFrame, nc_out::String) where {FT
 end
 
 
-@time dict = load("debug.jld2");
-@time wddf = prepare_wd(dict, "debug.nc");
+@time dict = load("$(@__DIR__)/debug.jld2");
+@time wddf = prepare_wd(dict, "$(@__DIR__)/debug.nc");
 @time spac = prepare_spac(dict);
-@time run_model!(spac, wddf, "debug.output.nc");
+@time run_model!(spac, wddf, "$(@__DIR__)/debug.output.nc");
diff --git a/src/CanopyLayers/CanopyLayers.jl b/src/CanopyLayers/CanopyLayers.jl
index b7371d5d..aee8ba9f 100755
--- a/src/CanopyLayers/CanopyLayers.jl
+++ b/src/CanopyLayers/CanopyLayers.jl
@@ -6,23 +6,20 @@ using ConstrainedRootSolvers: ReduceStepMethodND, SolutionToleranceND, find_peak
 using DocStringExtensions: TYPEDFIELDS, TYPEDEF
 using EmeraldConstants: AVOGADRO, H_PLANCK, K_STEFAN, LIGHT_SPEED, T₂₅
 using LinearAlgebra: mul!, pinv
-using MAT: matread
+using NetcdfIO: read_nc
 using PkgUtility: numerical∫
 using QuadGK: quadgk
 using SpecialFunctions: expint
 using Statistics: mean
-using TextIO: read_csv
-using UnPack: @unpack
 
 
-
-
-# define the constants
-const FILE_SUN  = artifact"land_model_spectrum_V1" * "/sun.mat";
-const OPTI_2017 = artifact"land_model_spectrum_V1" *
-                  "/Optipar2017_ProspectD.mat";
-const OPTI_2021 = artifact"land_model_spectrum_V1" *
-                  "/Optipar2021_ProspectPRO_CX.mat";
+# define the constants (do not use V1 which contains the raw mat code from the SCOPE model)
+const LAND_2017_V6 = artifact"land_model_spectrum_V6" * "/clima_land_spectra_2017.nc";
+const LAND_2017_V7 = artifact"land_model_spectrum_V7" * "/clima_land_spectra_2017.nc";
+const LAND_2021_V6 = artifact"land_model_spectrum_V6" * "/clima_land_spectra_2021.nc";
+const LAND_2021_V7 = artifact"land_model_spectrum_V7" * "/clima_land_spectra_2021.nc";
+const LAND_2017    = LAND_2017_V6;
+const LAND_2021    = LAND_2021_V6;
 const SOIL_BNDS = [0.36 0.61 0.25 0.50; 0.34 0.57 0.23 0.46;
                    0.32 0.53 0.21 0.42; 0.31 0.51 0.20 0.40;
                    0.30 0.49 0.19 0.38; 0.29 0.48 0.18 0.36;
@@ -33,75 +30,51 @@ const SOIL_BNDS = [0.36 0.61 0.25 0.50; 0.34 0.57 0.23 0.46;
                    0.18 0.29 0.09 0.18; 0.16 0.27 0.08 0.16;
                    0.14 0.25 0.07 0.14; 0.12 0.23 0.06 0.12;
                    0.10 0.21 0.05 0.10; 0.08 0.16 0.04 0.08];
-const SOIL_GSV  = artifact"land_model_spectrum_V1" * "/GSV.csv";
-
-
 
 
 # export public types
-export Canopy4RT, CanopyOpticals, CanopyRads, IncomingRadiation, LeafBios,
-       LeafOpticals, RTCache, RTDimensions, SoilOpticals, SolarAngles,
-       WaveLengths
+export Canopy4RT, CanopyOpticals, CanopyRads, IncomingRadiation, LeafBios, LeafOpticals, RTCache, RTDimensions, SoilOpticals, SolarAngles, WaveLengths
 
 # export public functions
-export big_leaf_partition, canopy_fluxes!, canopy_geometry!, canopy_matrices!,
-       create_canopy_opticals, create_canopy_rads, create_canopy_rt,
-       create_incoming_radiation, create_leaf_bios, create_leaf_opticals,
-       create_rt_cache, create_rt_dims, create_wave_length, diffusive_S,
-       fluspect!, initialize_rt_module, leaf_fluxes, short_wave!, SIF_fluxes!,
-       thermal_fluxes!
+export canopy_fluxes!, canopy_geometry!, canopy_matrices!, diffusive_S, fluspect!, initialize_rt_module, leaf_fluxes, short_wave!, SIF_fluxes!, thermal_fluxes!
 
 # Vegetation indices
-export BLUE, EVI, EVI2, LSWI, NDVI, NIR, NIRv, NIRvES, RED, REF_WL, SIF_683,
-       SIF_740, SIF_757, SIF_771, SIF_WL, SWIR
-
-
-
-
-include("utils/calctav.jl"    )
-include("utils/dladgen.jl"    )
-include("utils/e2phot.jl"     )
-include("utils/psofunction.jl")
-include("utils/volscatt.jl"   )
-
-include("types/canopy4rt.jl"     )
-include("types/canopyopticals.jl")
-include("types/canopyrads.jl"    )
-include("types/caches.jl"        )
-include("types/incomingrad.jl"   )
-include("types/leafbios.jl"      )
-include("types/leafopticals.jl"  )
-include("types/rtdims.jl"        )
-include("types/solarangles.jl"   )
-include("types/wavelength.jl"    )
-include("types/soilopticals.jl"  )
-
-include("initialize/all.jl"           )
-include("initialize/canopy4rt.jl"     )
-include("initialize/canopyopticals.jl")
-include("initialize/canopyrads.jl"    )
-include("initialize/caches.jl"        )
-include("initialize/incomingrad.jl"   )
-include("initialize/leafbios.jl"      )
-include("initialize/leafopticals.jl"  )
-include("initialize/rtdims.jl"        )
-include("initialize/wavelength.jl"    )
-
-include("bigleaf/bigleaf.jl")
-
-include("layers/canopyfluxes.jl"  )
-include("layers/canopygeometry.jl")
-include("layers/canopymatrices.jl")
-include("layers/diffusives.jl"    )
-include("layers/fluspect.jl"      )
-include("layers/indicies.jl"      )
-include("layers/leaf.jl"          )
-include("layers/shortwave.jl"     )
-include("layers/siffluxes.jl"     )
-include("layers/soil.jl"          )
-include("layers/thermalfluxes.jl" )
-
-
+export BLUE, EVI, EVI2, LSWI, NDVI, NIR, NIRv, NIRvES, RED, REF_WL, SIF_683, SIF_740, SIF_757, SIF_771, SIF_WL, SWIR
+
+
+include("utils/calctav.jl");
+include("utils/dladgen.jl");
+include("utils/e2phot.jl");
+include("utils/psofunction.jl");
+include("utils/volscatt.jl");
+
+include("types/canopy4rt.jl");
+include("types/leafopticals.jl");
+include("types/wavelength.jl");
+
+include("types/rtdims.jl");
+
+include("types/canopyopticals.jl");
+include("types/canopyrads.jl");
+include("types/caches.jl");
+include("types/incomingrad.jl");
+include("types/leafbios.jl");
+include("types/solarangles.jl");
+include("types/soilopticals.jl");
+
+include("initialize/all.jl");
+
+include("layers/canopyfluxes.jl");
+include("layers/canopygeometry.jl");
+include("layers/canopymatrices.jl");
+include("layers/diffusives.jl");
+include("layers/fluspect.jl");
+include("layers/indicies.jl");
+include("layers/leaf.jl");
+include("layers/shortwave.jl");
+include("layers/siffluxes.jl");
+include("layers/soil.jl");
+include("layers/thermalfluxes.jl");
 
 
 end # module
diff --git a/src/CanopyLayers/bigleaf/bigleaf.jl b/src/CanopyLayers/bigleaf/bigleaf.jl
deleted file mode 100644
index e72b1172..00000000
--- a/src/CanopyLayers/bigleaf/bigleaf.jl
+++ /dev/null
@@ -1,85 +0,0 @@
-###############################################################################
-#
-# Big leaf canopy model
-#
-###############################################################################
-const _K_D         = 0.7
-const _ALPAR       = 0.8
-const _ALNIR       = 0.2
-const _ALPAR_SQ    = sqrt(_ALPAR)
-const _ALNIR_SQ    = sqrt(_ALNIR)
-const _ALPAR_SQ_KD = _ALPAR_SQ * _K_D
-const _ALNIR_SQ_KD = _ALNIR_SQ * _K_D
-
-"""
-    big_leaf_partition(
-                lai::FT,
-                zenith::FT,
-                r_all::FT,
-                r_dir::FT = FT(0.8)
-    ) where {FT<:AbstractFloat}
-
-Partition the big-leaf canopy into sunlit and shaded layers, given
-- `lai` Leaf area index
-- `zenith` Zenith angle in degree
-- `r_all` Total radiation in `[W m⁻²]`
-- `r_dir` Direct radiation partition in `r_all`
-
-The function returns
-- `ratio` ratio of sunlit leaves out of all leaves
-- `q_slm` Mean sunlit layer PAR
-- `q_shm` Mean shaded layer PAR
-- `e_sl` Mean sunlit layer absorbed total energy
-- `e_sh` Mean shaded layer absorbed total energy
-"""
-function big_leaf_partition(
-            lai::FT,
-            zenith::FT,
-            r_all::FT,
-            r_dir::FT = FT(0.8)
-) where {FT <:AbstractFloat}
-    # 1. assume 50%-50% PAR and NIR
-    par_tot = r_all / 2 / FT(0.235);
-    q_ob    = par_tot * r_dir;
-    q_od    = par_tot * (1 - r_dir);
-
-    # 2. calculate the LAI
-    shape = FT(1.0);
-    shapa = FT(2.0);
-
-    # 3. calculate the mean sunlit layer PAR
-    # For vertical leaves k_be = 2.0 * tand(zenith) / pi
-    k_be  = sqrt( shape^2+tand(zenith)^2 ) /
-              ( shape + FT(1.774) * (shape+FT(1.182))^FT(-0.733) );
-    q_btp = q_ob * exp( -FT(_ALPAR_SQ) * k_be * lai );
-    q_btn = q_ob * exp( -FT(_ALNIR_SQ) * k_be * lai );
-    q_b   = q_ob * exp( -k_be*lai );
-    q_scp = q_btp - q_b;
-    q_scn = q_btn - q_b;
-
-    # 4. mean par in sunlit and shade layers
-    q_dm  = q_od * ( 1 - exp(-FT(_ALPAR_SQ_KD)) ) / ( FT(_ALPAR_SQ_KD) * lai );
-    r_dm  = q_od * ( 1 - exp(-FT(_ALNIR_SQ_KD)) ) / ( FT(_ALNIR_SQ_KD) * lai );
-    q_shm = q_dm + q_scp/shapa;
-    r_shm = r_dm + q_scn/shapa;
-    q_slm = k_be*q_ob + q_dm + q_scp/shapa;
-    r_slm = k_be*q_ob + r_dm + q_scn/shapa;
-
-    # 5. calculate lasi_sl and lai_sh
-    lai_sl = ( 1 - exp(-k_be*lai) ) / k_be;
-    lai_sh = lai - lai_sl;
-    ratio  = lai_sl / lai;
-
-    # 6. calculate the radiation based on PAR and NIR
-    ep_sl = q_slm * FT(_ALPAR) * FT(0.235);
-    ep_sh = q_shm * FT(_ALPAR) * FT(0.235);
-    en_sl = r_slm * FT(_ALNIR) * FT(0.235);
-    en_sh = r_shm * FT(_ALNIR) * FT(0.235);
-
-    # e_sl and e_sh are leaf-area-based mean radiation
-    e_sl = ep_sl + en_sl;
-    e_sh = ep_sh + en_sh;
-
-    # return values
-    return ratio, q_slm, q_shm, e_sl, e_sh
-end
diff --git a/src/CanopyLayers/initialize/all.jl b/src/CanopyLayers/initialize/all.jl
index 32ad801e..1ff3e32e 100644
--- a/src/CanopyLayers/initialize/all.jl
+++ b/src/CanopyLayers/initialize/all.jl
@@ -1,8 +1,3 @@
-###############################################################################
-#
-# Initialize the RT module
-#
-###############################################################################
 """
     initialize_rt_module(FT; nLayer::Int = 20, LAI::Number = FT(3))
 
@@ -17,30 +12,30 @@ This function initializes and returns
 - `can_opt` [`CanopyOpticals`](@ref)
 - `can_rad` [`CanopyRads`](@ref)
 - `in_rad` [`IncomingRadiation`](@ref)
-- `leaves` Array{[`LeafBios`](@ref),1}
+- `leaves` Vector{[`LeafBios`](@ref)}
 - `rt_con` [`RTCache`](@ref)
 - `rt_dim` [`RTDimensions`](@ref)
 - `soil` [`SoilOpticals`](@ref)
 - `wls` [`WaveLengths`](@ref)
 """
-function initialize_rt_module(FT; nLayer::Int = 20, LAI::Number = FT(3))
+function initialize_rt_module(FT; nLayer::Int = 20, LAI::Number = 3, opti_file::String = LAND_2021)
     # 1. create wls and can, which are rt_dims independent
-    can = create_canopy_rt(FT, nLayer=nLayer, LAI=LAI);
-    wls = create_wave_length(FT);
+    can = Canopy4RT{FT}(nLayer = nLayer, LAI = LAI);
+    wls = WaveLengths{FT}(opti_file = opti_file);
 
     # 2. create rt_dims from wls and can
-    rt_dim = create_rt_dims(can, wls);
+    rt_dim = RTDimensions(can, wls);
 
     # 3. create can_rad, can_opt, and etc from rt_dim and wls
-    can_rad = create_canopy_rads(FT, rt_dim);
-    can_opt = create_canopy_opticals(FT, rt_dim);
-    in_rad  = create_incoming_radiation(wls);
-    soil    = SoilOpticals{FT}(wls);
+    can_rad = CanopyRads{FT}(rt_dim);
+    can_opt = CanopyOpticals{FT}(rt_dim);
+    in_rad  = IncomingRadiation(wls);
+    soil    = SoilOpticals(wls);
     angles  = SolarAngles{FT}();
-    rt_con  = create_rt_cache(FT, rt_dim);
+    rt_con  = RTCache{FT}(rt_dim);
 
     # Create an array of standard leaves
-    leaves = [create_leaf_bios(FT, rt_dim) for i in 1:nLayer];
+    leaves = [LeafBios{FT}(rt_dim) for i in 1:nLayer];
     for i in 1:nLayer
         fluspect!(leaves[i], wls);
     end
@@ -53,7 +48,7 @@ function initialize_rt_module(FT; nLayer::Int = 20, LAI::Number = FT(3))
     SIF_fluxes!(leaves, can_opt, can_rad, can, soil, wls, rt_con, rt_dim);
 
     # # Compute Long Wave (Last term is LW incoming in W m^-2)
-    thermal_fluxes!(leaves, can_opt, can_rad, can, soil, [FT(400.0)], wls);
+    thermal_fluxes!(leaves, can_opt, can_rad, can, soil, [FT(400)], wls);
 
     return angles, can, can_opt, can_rad, in_rad, leaves, rt_con, rt_dim, soil, wls
 end
diff --git a/src/CanopyLayers/initialize/caches.jl b/src/CanopyLayers/initialize/caches.jl
deleted file mode 100644
index 43ebd490..00000000
--- a/src/CanopyLayers/initialize/caches.jl
+++ /dev/null
@@ -1,281 +0,0 @@
-###############################################################################
-#
-# Initialize CFCache
-#
-###############################################################################
-"""
-    create_cf_cache(FT, rt_dim::RTDimensions)
-
-Create a [`CFCache`](@ref) type struct, given
-- `FT` Floating number type
-- `rt_dim` [`RTDimensions`](@ref) type struct
-"""
-function create_cf_cache(FT, rt_dim::RTDimensions)
-    @unpack nAzi, nLayer, nPAR, nWL = rt_dim;
-
-    abs_wave    = zeros(FT, nWL   );
-    absfs_lidf  = zeros(FT, nAzi  );
-    E_all       = zeros(FT, nWL   );
-    E_iPAR      = zeros(FT, nPAR  );
-    lPs         = zeros(FT, nLayer);
-    kChlrel     = zeros(FT, nPAR  );
-    PAR_diff    = zeros(FT, nPAR  );
-    PAR_diffCab = zeros(FT, nPAR  );
-    PAR_dir     = zeros(FT, nPAR  );
-    PAR_dirCab  = zeros(FT, nPAR  );
-
-    return CFCache{FT}(abs_wave    = abs_wave   ,
-                       absfs_lidf  = absfs_lidf ,
-                       E_all       = E_all      ,
-                       E_iPAR      = E_iPAR     ,
-                       lPs         = lPs        ,
-                       kChlrel     = kChlrel    ,
-                       PAR_diff    = PAR_diff   ,
-                       PAR_diffCab = PAR_diffCab,
-                       PAR_dir     = PAR_dir    ,
-                       PAR_dirCab  = PAR_dirCab )
-end
-
-
-
-
-
-
-
-
-###############################################################################
-#
-# Initialize CGCache
-#
-###############################################################################
-"""
-    create_cg_cache(FT, rt_dim::RTDimensions)
-
-Create a [`CGCache`](@ref) type struct, given
-- `FT` Floating number type
-- `rt_dim` [`RTDimensions`](@ref) type struct
-"""
-function create_cg_cache(FT, rt_dim::RTDimensions)
-    @unpack nAzi, nIncl = rt_dim;
-
-    _Co  = zeros(FT, nIncl);
-    _Cs  = zeros(FT, nIncl);
-    _So  = zeros(FT, nIncl);
-    _Ss  = zeros(FT, nIncl);
-
-    _1s  =  ones(FT, (1    , nAzi));
-    _2d  = zeros(FT, (nIncl, nAzi));
-    _cdo = zeros(FT, (nIncl, nAzi));
-    _cds = zeros(FT, (nIncl, nAzi));
-
-    return CGCache{FT}(_Co  = _Co ,
-                       _Cs  = _Cs ,
-                       _So  = _So ,
-                       _Ss  = _Ss ,
-                       _1s  = _1s ,
-                       _2d  = _2d ,
-                       _cdo = _cdo,
-                       _cds = _cds)
-end
-
-
-
-
-
-
-
-
-###############################################################################
-#
-# Initialize SWCache
-#
-###############################################################################
-"""
-    create_sf_cache(FT, rt_dim::RTDimensions)
-
-Create a [`SFCache`](@ref) type struct, given
-- `FT` Floating number type
-- `rt_dim` [`RTDimensions`](@ref) type struct
-"""
-function create_sf_cache(FT, rt_dim::RTDimensions)
-    @unpack nAzi, nIncl, nLayer, nLevel, nWLE, nWLF = rt_dim;
-
-    τ_dd            = zeros(FT, (nWLF,nLayer));
-    Xdd             = zeros(FT, (nWLF,nLayer));
-    Rdd             = zeros(FT, (nWLF,nLevel));
-    Y               = zeros(FT, (nWLF,nLayer));
-    U               = zeros(FT, (nWLF,nLevel));
-    dnorm           = zeros(FT, nWLF);
-    ρ_dd            = zeros(FT, (nWLF,nLayer));
-    S⁻              = zeros(FT, (nWLF,nLayer));
-    S⁺              = zeros(FT, (nWLF,nLayer));
-    piLs            = zeros(FT, (nWLF,nLayer));
-    piLd            = zeros(FT, (nWLF,nLayer));
-    Fsmin           = zeros(FT, (nWLF,nLayer));
-    Fsplu           = zeros(FT, (nWLF,nLayer));
-    Fdmin           = zeros(FT, (nWLF,nLayer));
-    Fdplu           = zeros(FT, (nWLF,nLayer));
-    Femo            = zeros(FT, (nWLF,nLayer));
-    M⁺              = zeros(FT, (nWLF,nWLE));
-    M⁻              = zeros(FT, (nWLF,nWLE));
-    M⁻_sun          = zeros(FT, nWLF);
-    M⁺_sun          = zeros(FT, nWLF);
-    wfEs            = zeros(FT, nWLF);
-    sfEs            = zeros(FT, nWLF);
-    sbEs            = zeros(FT, nWLF);
-    M⁺⁻             = zeros(FT, nWLF);
-    M⁺⁺             = zeros(FT, nWLF);
-    M⁻⁺             = zeros(FT, nWLF);
-    M⁻⁻             = zeros(FT, nWLF);
-    sun_dwl_iWlE    = zeros(FT, nWLE);
-    tmp_dwl_iWlE    = zeros(FT, nWLE);
-    ϕ_cosΘ          = zeros(FT, (nIncl,nAzi));
-    ϕ_cosΘ_lidf     = zeros(FT, nAzi);
-    vfEplu_shade    = zeros(FT, nWLF);
-    vbEmin_shade    = zeros(FT, nWLF);
-    vfEplu_sun      = zeros(FT, nWLF);
-    vbEmin_sun      = zeros(FT, nWLF);
-    sigfEmin_shade  = zeros(FT, nWLF);
-    sigbEmin_shade  = zeros(FT, nWLF);
-    sigfEmin_sun    = zeros(FT, nWLF);
-    sigbEmin_sun    = zeros(FT, nWLF);
-    sigfEplu_shade  = zeros(FT, nWLF);
-    sigbEplu_shade  = zeros(FT, nWLF);
-    sigfEplu_sun    = zeros(FT, nWLF);
-    sigbEplu_sun    = zeros(FT, nWLF);
-    zeroB           = zeros(FT, nWLF);
-    F⁻              = zeros(FT, (nWLF,nLevel));
-    F⁺              = zeros(FT, (nWLF,nLevel));
-    net_diffuse     = zeros(FT, (nWLF,nLayer));
-    tmp_1d_nWlF     = zeros(FT, nWLF);
-    tmp_1d_nLayer   = zeros(FT, nLayer);
-    tmp_2d_nWlF_nLayer   = zeros(FT, (nWLF,nLayer));
-    tmp_2d_nWlF_nLayer_2 = zeros(FT, (nWLF,nLayer));
-
-    return SFCache{FT}(τ_dd                 = τ_dd                ,
-                       Xdd                  = Xdd                 ,
-                       Rdd                  = Rdd                 ,
-                       Y                    = Y                   ,
-                       U                    = U                   ,
-                       dnorm                = dnorm               ,
-                       ρ_dd                 = ρ_dd                ,
-                       S⁻                   = S⁻                  ,
-                       S⁺                   = S⁺                  ,
-                       piLs                 = piLs                ,
-                       piLd                 = piLd                ,
-                       Fsmin                = Fsmin               ,
-                       Fsplu                = Fsplu               ,
-                       Fdmin                = Fdmin               ,
-                       Fdplu                = Fdplu               ,
-                       Femo                 = Femo                ,
-                       M⁺                   = M⁺                  ,
-                       M⁻                   = M⁻                  ,
-                       M⁻_sun               = M⁻_sun              ,
-                       M⁺_sun               = M⁺_sun              ,
-                       wfEs                 = wfEs                ,
-                       sfEs                 = sfEs                ,
-                       sbEs                 = sbEs                ,
-                       M⁺⁻                  = M⁺⁻                 ,
-                       M⁺⁺                  = M⁺⁺                 ,
-                       M⁻⁺                  = M⁻⁺                 ,
-                       M⁻⁻                  = M⁻⁻                 ,
-                       sun_dwl_iWlE         = sun_dwl_iWlE        ,
-                       tmp_dwl_iWlE         = tmp_dwl_iWlE        ,
-                       ϕ_cosΘ               = ϕ_cosΘ              ,
-                       ϕ_cosΘ_lidf          = ϕ_cosΘ_lidf         ,
-                       vfEplu_shade         = vfEplu_shade        ,
-                       vbEmin_shade         = vbEmin_shade        ,
-                       vfEplu_sun           = vfEplu_sun          ,
-                       vbEmin_sun           = vbEmin_sun          ,
-                       sigfEmin_shade       = sigfEmin_shade      ,
-                       sigbEmin_shade       = sigbEmin_shade      ,
-                       sigfEmin_sun         = sigfEmin_sun        ,
-                       sigbEmin_sun         = sigbEmin_sun        ,
-                       sigfEplu_shade       = sigfEplu_shade      ,
-                       sigbEplu_shade       = sigbEplu_shade      ,
-                       sigfEplu_sun         = sigfEplu_sun        ,
-                       sigbEplu_sun         = sigbEplu_sun        ,
-                       zeroB                = zeroB               ,
-                       F⁻                   = F⁻                  ,
-                       F⁺                   = F⁺                  ,
-                       net_diffuse          = net_diffuse         ,
-                       tmp_1d_nWlF          = tmp_1d_nWlF         ,
-                       tmp_1d_nLayer        = tmp_1d_nLayer       ,
-                       tmp_2d_nWlF_nLayer   = tmp_2d_nWlF_nLayer  ,
-                       tmp_2d_nWlF_nLayer_2 = tmp_2d_nWlF_nLayer_2)
-end
-
-
-
-
-
-
-
-
-###############################################################################
-#
-# Initialize SWCache
-#
-###############################################################################
-"""
-    create_sw_cache(FT, rt_dim::RTDimensions)
-
-Create a [`CGCache`](@ref) type struct, given
-- `FT` Floating number type
-- `rt_dim` [`RTDimensions`](@ref) type struct
-"""
-function create_sw_cache(FT, rt_dim::RTDimensions)
-    @unpack nLayer, nWL = rt_dim;
-
-    dnorm  = zeros(FT, nWL);
-    piLo   = zeros(FT, nWL);
-    piLoc  = zeros(FT, nWL);
-    piLos  = zeros(FT, nWL);
-
-    piLoc2 = zeros(FT, (nWL,nLayer));
-    ρ_dd   = zeros(FT, (nWL,nLayer));
-    ρ_sd   = zeros(FT, (nWL,nLayer));
-    τ_dd   = zeros(FT, (nWL,nLayer));
-    τ_sd   = zeros(FT, (nWL,nLayer));
-
-    return SWCache{FT}(dnorm  = dnorm ,
-                       piLo   = piLo  ,
-                       piLoc  = piLoc ,
-                       piLos  = piLos ,
-                       piLoc2 = piLoc2,
-                       ρ_dd   = ρ_dd  ,
-                       ρ_sd   = ρ_sd  ,
-                       τ_dd   = τ_dd  ,
-                       τ_sd   = τ_sd  )
-end
-
-
-
-
-
-
-
-
-###############################################################################
-#
-# Initialize RTCache
-#
-###############################################################################
-"""
-    create_rt_cache(FT, rt_dim::RTDimensions)
-
-Create an [`RTCache`](@ref), given
-- `FT` Floating number type
-- `rt_dim` [`RTDimensions`](@ref) type struct
-"""
-function create_rt_cache(FT, rt_dim::RTDimensions)
-    cf_con = create_cf_cache(FT, rt_dim);
-    cg_con = create_cg_cache(FT, rt_dim);
-    sf_con = create_sf_cache(FT, rt_dim);
-    sw_con = create_sw_cache(FT, rt_dim);
-
-    return RTCache{FT}(cf_con = cf_con,
-                       cg_con = cg_con,
-                       sf_con = sf_con,
-                       sw_con = sw_con)
-end
diff --git a/src/CanopyLayers/initialize/canopy4rt.jl b/src/CanopyLayers/initialize/canopy4rt.jl
deleted file mode 100644
index 84406c2c..00000000
--- a/src/CanopyLayers/initialize/canopy4rt.jl
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-#
-# Initialize Canopy4RT
-#
-###############################################################################
-"""
-    create_canopy_rt(FT; nLayer::Int = 20, LAI::Number = FT(3))
-
-Create [`Canopy4RT`](@ref), given
-- `FT` Floating number type
-- `nLayer` Number of canopy layers
-- `LAI` Leaf area index
-"""
-function create_canopy_rt(FT; nLayer::Int = 20, LAI::Number = FT(3))
-    return Canopy4RT{FT}(LAI    = LAI   ,
-                         nLayer = nLayer)
-end
diff --git a/src/CanopyLayers/initialize/canopyopticals.jl b/src/CanopyLayers/initialize/canopyopticals.jl
deleted file mode 100644
index 271745a1..00000000
--- a/src/CanopyLayers/initialize/canopyopticals.jl
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-#
-# Initialize CanopyOpticals
-#
-###############################################################################
-"""
-    create_canopy_opticals( FT, rt_dim::RTDimensions)
-
-Create a [`CanopyOpticals`](@ref) struct, given
-- `FT` Floating number type
-- `rt_dim` [`RTDimensions`](@ref) type struct
-"""
-function create_canopy_opticals(FT, rt_dim::RTDimensions)
-    @unpack nAzi, nIncl, nLayer, nWL = rt_dim;
-
-    return CanopyOpticals{FT}(nAzi   = nAzi  ,
-                              nIncl  = nIncl ,
-                              nLayer = nLayer,
-                              nWL    = nWL   )
-end
diff --git a/src/CanopyLayers/initialize/canopyrads.jl b/src/CanopyLayers/initialize/canopyrads.jl
deleted file mode 100644
index f482a017..00000000
--- a/src/CanopyLayers/initialize/canopyrads.jl
+++ /dev/null
@@ -1,22 +0,0 @@
-###############################################################################
-#
-# Initialize CanopyOpticals
-#
-###############################################################################
-"""
-    create_canopy_rads(FT, rt_dim::RTDimensions)
-
-Create a [`CanopyRads`](@ref) struct, given
-- `FT` Floating number type
-- `rt_dim` [`RTDimensions`](@ref) type struct
-"""
-function create_canopy_rads(FT, rt_dim::RTDimensions)
-    @unpack nAzi, nIncl, nLayer, nLevel, nWL, nWLF = rt_dim;
-
-    return CanopyRads{FT}(nAzi   = nAzi  ,
-                          nIncl  = nIncl ,
-                          nLayer = nLayer,
-                          nLevel = nLevel,
-                          nWL    = nWL   ,
-                          nWLF   = nWLF  )
-end
diff --git a/src/CanopyLayers/initialize/incomingrad.jl b/src/CanopyLayers/initialize/incomingrad.jl
deleted file mode 100644
index 4ca8f6ef..00000000
--- a/src/CanopyLayers/initialize/incomingrad.jl
+++ /dev/null
@@ -1,48 +0,0 @@
-###############################################################################
-#
-# Create IncomingRadiation
-#
-###############################################################################
-"""
-    create_incoming_radiation(
-                wls::WaveLengths{FT},
-                wlfn::String = FILE_SUN
-    ) where {FT<:AbstractFloat}
-
-Create an `AbstractIncomingRadiation` struct, given
-- `wls` [`WaveLengths`](@ref) type struct
-- `wlfn` File that saves incoming wave information
-"""
-function create_incoming_radiation(
-            wls::WaveLengths{FT},
-            wlfn::String = FILE_SUN
-) where {FT<:AbstractFloat}
-    @unpack sWL, nWL = wls;
-
-    # Read data
-    _suni  = matread(wlfn)["sun"]
-    _wl    = _suni["wl"      ]
-    _Edir  = _suni["Edirect" ]
-    _Ediff = _suni["Ediffuse"]
-
-    # create arrays
-    # WL  = zeros(FT, N)
-    Edir  = zeros(FT, nWL)
-    Ediff = zeros(FT, nWL)
-
-    # fill in the arrays
-    # println("Reading Optical Parameters from ", sWL[1], " to ", sWL[end])
-    for i in 1:nWL
-        wo = findall( (_wl.>=sWL[i]) .& (_wl.<sWL[i+1]) )
-        if length(wo)==0
-            @warn "Some wavelengths out of bounds $(string(sWL[i]))";
-        end
-        # remove WL to avoid duplication
-        # WL[i]  = mean(   _wl[wo])
-        Edir[i]  = mean( _Edir[wo])
-        Ediff[i] = mean(_Ediff[wo])
-    end
-
-    # create struct from the arrays
-    return IncomingRadiation{FT}(Edir, Ediff)
-end
diff --git a/src/CanopyLayers/initialize/leafbios.jl b/src/CanopyLayers/initialize/leafbios.jl
deleted file mode 100644
index 8852dc0f..00000000
--- a/src/CanopyLayers/initialize/leafbios.jl
+++ /dev/null
@@ -1,19 +0,0 @@
-###############################################################################
-#
-# Create LeafBios
-#
-###############################################################################
-"""
-    create_leaf_bios(FT, rt_dim::RTDimensions)
-
-Create a [`LeafBios`](@ref) type struct, given
-- `FT` Floating number type
-- `rt_dim` [`RTDimensions`](@ref) type struct
-"""
-function create_leaf_bios(FT, rt_dim::RTDimensions)
-    @unpack nWL, nWLE, nWLF = rt_dim;
-
-    return LeafBios{FT}(nWL  = nWL ,
-                        nWLE = nWLE,
-                        nWLF = nWLF)
-end
diff --git a/src/CanopyLayers/initialize/leafopticals.jl b/src/CanopyLayers/initialize/leafopticals.jl
deleted file mode 100644
index 4b52d53a..00000000
--- a/src/CanopyLayers/initialize/leafopticals.jl
+++ /dev/null
@@ -1,82 +0,0 @@
-###############################################################################
-#
-# Create LeafOpticals
-#
-###############################################################################
-"""
-    create_leaf_opticals(
-                sWL::Array{FT,1},
-                file::String = OPTI_2021
-    ) where {FT<:AbstractFloat}
-
-Create an `AbstractLeafOptiPara` struct, given
-- `sWL` Standard wave length
-- `opfn` File that saves optical parameters
-"""
-function create_leaf_opticals(
-            sWL::Array{FT,1},
-            opfn::String = OPTI_2021
-) where {FT<:AbstractFloat}
-    N = length(sWL) - 1;
-
-    # reading data
-    _opti   = matread(opfn)["optipar"];
-    _nr     = _opti["nr"  ];
-    _Km     = _opti["Kdm" ];
-    _Kab    = _opti["Kab" ];
-    _Kant   = _opti["Kant"];
-    _Kcar   = _opti["Kca" ];
-    _Kw     = _opti["Kw"  ];
-    _KBrown = _opti["Ks"  ];
-    _phi    = _opti["phi" ];
-    _KcaV   = _opti["KcaV"];
-    _KcaZ   = _opti["KcaZ"];
-    _lambda = _opti["wl"  ];
-
-    # create data to parse
-    nr     = zeros(FT, N);
-    Km     = zeros(FT, N);
-    Kab    = zeros(FT, N);
-    Kant   = zeros(FT, N);
-    Kcar   = zeros(FT, N);
-    Kw     = zeros(FT, N);
-    KBrown = zeros(FT, N);
-    phi    = zeros(FT, N);
-    KcaV   = zeros(FT, N);
-    KcaZ   = zeros(FT, N);
-    lambda = zeros(FT, N);
-
-    # fill in the data arrays
-    # println("Reading Optical Parameters from ", sWL[1], " to ", sWL[end])
-    @inbounds for i in 1:N
-        wo = findall( (_lambda.>=sWL[i]) .& (_lambda.<sWL[i+1]) );
-        if length(wo)==0
-            @warn "Warning, some wavelengths out of bounds $(string(sWL[i]))";
-        end
-
-        nr[i]     = mean(    _nr[wo]);
-        Km[i]     = mean(    _Km[wo]);
-        Kab[i]    = mean(   _Kab[wo]);
-        Kant[i]   = mean(  _Kant[wo]);
-        Kcar[i]   = mean(  _Kcar[wo]);
-        Kw[i]     = mean(    _Kw[wo]);
-        KBrown[i] = mean(_KBrown[wo]);
-        phi[i]    = mean(   _phi[wo]);
-        KcaV[i]   = mean(  _KcaV[wo]);
-        KcaZ[i]   = mean(  _KcaZ[wo]);
-        lambda[i] = mean(_lambda[wo]);
-    end
-
-    # return the created struct
-    return LeafOpticals{FT}(nr,
-                            Km,
-                            Kab,
-                            Kant,
-                            Kcar,
-                            Kw,
-                            KBrown,
-                            phi,
-                            KcaV,
-                            KcaZ,
-                            lambda)
-end
diff --git a/src/CanopyLayers/initialize/rtdims.jl b/src/CanopyLayers/initialize/rtdims.jl
deleted file mode 100644
index 5ae2eed2..00000000
--- a/src/CanopyLayers/initialize/rtdims.jl
+++ /dev/null
@@ -1,30 +0,0 @@
-###############################################################################
-#
-# Initialize RTDimensions
-#
-###############################################################################
-"""
-    create_rt_dims(
-                can::Canopy4RT{FT},
-                wls::WaveLengths{FT}
-    ) where {FT<:AbstractFloat}
-
-Create [`RTDimensions`](@ref), given
-- `can` [`Canopy4RT`](@ref) type struct
-- `wls` [`WaveLengths`](@ref) type struct
-"""
-function create_rt_dims(
-            can::Canopy4RT{FT},
-            wls::WaveLengths{FT}
-) where {FT<:AbstractFloat}
-    @unpack nAzi, nIncl, nLayer = can;
-    @unpack nPAR, nWL, nWLE, nWLF = wls;
-
-    return RTDimensions(nAzi   = nAzi  ,
-                        nIncl  = nIncl ,
-                        nLayer = nLayer,
-                        nPAR   = nPAR  ,
-                        nWL    = nWL   ,
-                        nWLE   = nWLE  ,
-                        nWLF   = nWLF  )
-end
diff --git a/src/CanopyLayers/initialize/wavelength.jl b/src/CanopyLayers/initialize/wavelength.jl
deleted file mode 100644
index dc5b9edf..00000000
--- a/src/CanopyLayers/initialize/wavelength.jl
+++ /dev/null
@@ -1,27 +0,0 @@
-###############################################################################
-#
-# Initialize WaveLengths
-#
-###############################################################################
-"""
-
-    create_wave_length(FT, sWLs = [collect(400.0:10.0: 650.1); collect(655.0: 5.0: 770.1); collect(780.0:25.0:2400.1)];
-                       max_NIR::Number = 2500, max_PAR::Number = 700, min_NIR::Number = 700, min_PAR::Number = 400, opti_file::String = OPTI_2021)
-
-Create [`WaveLengths`](@ref) type struct, given
-- `FT` Floating number type
-- `sWLs` Shortwave wavelength bins
-- `max_NIR` Maximal NIR wavelength
-- `max_PAR` Maximal PAR wavelength
-- `min_NIR` Minimal NIR wavelength
-- `min_PAR` Minimal PAR wavelength
-- `opti_file` Input reference optical file path
-
-"""
-function create_wave_length(FT, sWLs = [collect(400.0:10.0: 650.1); collect(655.0: 5.0: 770.1); collect(780.0:25.0:2400.1)];
-                            max_NIR::Number = 2500, max_PAR::Number = 700, min_NIR::Number = 700, min_PAR::Number = 400, opti_file::String = OPTI_2021)
-    sWL   = FT.(sWLs);
-    optis = create_leaf_opticals(sWL, opti_file);
-
-    return WaveLengths{FT}(minwlPAR = min_PAR, maxwlPAR = max_PAR, minwlNIR = min_NIR, maxwlNIR = max_NIR, sWL = sWL, optis = optis)
-end
diff --git a/src/CanopyLayers/layers/canopyfluxes.jl b/src/CanopyLayers/layers/canopyfluxes.jl
index 7107cb2b..1a7095fc 100644
--- a/src/CanopyLayers/layers/canopyfluxes.jl
+++ b/src/CanopyLayers/layers/canopyfluxes.jl
@@ -1,8 +1,3 @@
-###############################################################################
-#
-# Update canopy fluxes
-#
-###############################################################################
 """
     canopy_fluxes!(
                 can::Canopy4RT{FT},
@@ -10,7 +5,7 @@
                 can_rad::CanopyRads{FT},
                 in_rad::IncomingRadiation{FT},
                 soil::SoilOpticals{FT},
-                leaves::Array{LeafBios{FT},1},
+                leaves::Vector{LeafBios{FT}},
                 wls::WaveLengths{FT},
                 rt_con::RTCache{FT}
     ) where {FT<:AbstractFloat}
@@ -34,14 +29,14 @@ function canopy_fluxes!(
             can_rad::CanopyRads{FT},
             in_rad::IncomingRadiation{FT},
             soil::SoilOpticals{FT},
-            leaves::Array{LeafBios{FT},1},
+            leaves::Vector{LeafBios{FT}},
             wls::WaveLengths{FT},
             rt_con::RTCache{FT}
 ) where {FT<:AbstractFloat}
     # 1. unpack variables from structures
-    @unpack LAI, nLayer, Ω = can;
-    @unpack ρ_SW, ε_SW = soil;
-    @unpack dWL, dWL_iPAR, iPAR, WL, WL_iPAR = wls;
+    (; LAI, nLayer) = can;
+    (; ε_SW) = soil;
+    (; dWL, dWL_iPAR, dWL_iPAR_700, iPAR, iPAR_700, WL_iPAR) = wls;
     cf_con = rt_con.cf_con;
 
     # 2. compute some useful variables
@@ -62,9 +57,8 @@ function canopy_fluxes!(
     #    Direct PAR is normalized by layer Ps value
     mul!(cf_con.absfs_lidf, adjoint(can_opt.absfs), can.lidf);
     normi       = 1 / mean(cf_con.absfs_lidf);
-    cf_con.lPs .= (view(can_opt.Ps, 1:nLayer  ) .+
-                   view(can_opt.Ps, 2:nLayer+1)) ./ 2;
-    @unpack lPs = cf_con;
+    cf_con.lPs .= (view(can_opt.Ps, 1:nLayer) .+ view(can_opt.Ps, 2:nLayer+1)) ./ 2;
+    (; lPs) = cf_con;
 
     @inbounds for j in 1:nLayer
         if length(leaves)>1
@@ -81,7 +75,7 @@ function canopy_fluxes!(
         # for direct PAR
         cf_con.E_iPAR .= view(can_rad.netSW_sunlit, iPAR, j);
         e2phot!(WL_iPAR, cf_con.E_iPAR, cf_con.PAR_dir);
-        cf_con.PAR_dir .*= fac / tLAI;
+        cf_con.PAR_dir .*= fac / tLAI / lPs[j];
 
         # for leaf absorbed
         cf_con.PAR_diffCab .= cf_con.kChlrel .* cf_con.PAR_diff;
@@ -93,11 +87,15 @@ function canopy_fluxes!(
         can_rad.absPAR_shade[j] = _dif;
         can_rad.absPAR_sun[:,:,j] .= can_opt.absfs .* _dir;
 
-        # absorbed PAR for photosynthesis
-        _difCab = numerical∫(cf_con.PAR_diffCab, dWL_iPAR);
-        _dirCab = numerical∫(cf_con.PAR_dirCab , dWL_iPAR) * normi;
+        # absorbed PAR for photosynthesis (set it to be the lower of 2*X_700 or X_750)
+        _difCab_700 = numerical∫(cf_con.PAR_diffCab[iPAR_700], dWL_iPAR_700);
+        _dirCab_700 = numerical∫(cf_con.PAR_dirCab[iPAR_700] , dWL_iPAR_700) * normi;
+        _difCab_750 = numerical∫(cf_con.PAR_diffCab, dWL_iPAR);
+        _dirCab_750 = numerical∫(cf_con.PAR_dirCab , dWL_iPAR) * normi;
+        _difCab = min(2*_difCab_700, _difCab_750);
+        _dirCab = min(2*_dirCab_700, _dirCab_750);
         can_rad.absPAR_shadeCab[j] = _difCab;
-        can_rad.absPAR_sunCab[:,:,j]  .= can_opt.absfs .* _dirCab;
+        can_rad.absPAR_sunCab[:,:,j] .= can_opt.absfs .* _dirCab;
         can_rad.absPAR_sunCab[:,:,j] .+= _difCab;
     end
 
@@ -108,17 +106,14 @@ function canopy_fluxes!(
     e2phot!(WL_iPAR, cf_con.E_iPAR, cf_con.PAR_dir);
     cf_con.E_iPAR .= view(in_rad.E_diffuse, iPAR);
     e2phot!(WL_iPAR, cf_con.E_iPAR, cf_con.PAR_diff);
-    can_rad.incomingPAR_direct  = fac * numerical∫(cf_con.PAR_dir , dWL_iPAR);
+    can_rad.incomingPAR_direct = fac * numerical∫(cf_con.PAR_dir , dWL_iPAR);
     can_rad.incomingPAR_diffuse = fac * numerical∫(cf_con.PAR_diff, dWL_iPAR);
-    can_rad.incomingPAR         = can_rad.incomingPAR_diffuse +
-                                  can_rad.incomingPAR_direct;
+    can_rad.incomingPAR = can_rad.incomingPAR_diffuse + can_rad.incomingPAR_direct;
     @inbounds for i in 1:nLayer
         cf_con.E_all .= view(can_rad.netSW_shade, :, i);
-        can_rad.intNetSW_shade[i]  = numerical∫(cf_con.E_all, dWL) * fac / tLAI;
+        can_rad.intNetSW_shade[i] = numerical∫(cf_con.E_all, dWL) * fac / tLAI;
         cf_con.E_all .= view(can_rad.netSW_sunlit, :, i);
-        can_rad.intNetSW_sunlit[i] = numerical∫(cf_con.E_all, dWL) *
-                                     fac / tLAI / lPs[i] +
-                                     can_rad.intNetSW_shade[i];
+        can_rad.intNetSW_sunlit[i] = numerical∫(cf_con.E_all, dWL) * fac / tLAI / lPs[i] + can_rad.intNetSW_shade[i];
     end
 
     return nothing
diff --git a/src/CanopyLayers/layers/canopygeometry.jl b/src/CanopyLayers/layers/canopygeometry.jl
index 9fb3903b..84198325 100644
--- a/src/CanopyLayers/layers/canopygeometry.jl
+++ b/src/CanopyLayers/layers/canopygeometry.jl
@@ -4,21 +4,15 @@
 #
 ###############################################################################
 """
-    clumping_factor!(
-                can::Canopy4RT{FT},
-                angles::SolarAngles{FT}
-    ) where {FT<:AbstractFloat}
+    clumping_factor!(can::Canopy4RT{FT}, angles::SolarAngles{FT}) where {FT<:AbstractFloat}
 
 Calculate the clumping factor, given
 - `can` [`Canopy4RT`](@ref) type struct
 - `angles` [`SolarAngles`](@ref) type struct
 """
-function clumping_factor!(
-            can::Canopy4RT{FT},
-            angles::SolarAngles{FT}
-) where {FT<:AbstractFloat}
-    @unpack clump_a, clump_b = can;
-    @unpack sza = angles;
+function clumping_factor!(can::Canopy4RT{FT}, angles::SolarAngles{FT}) where {FT<:AbstractFloat}
+    (; clump_a, clump_b) = can;
+    (; sza) = angles;
 
     if clump_b > 0
         can.Ω = clump_a + clump_b * (1 - cosd(sza));
@@ -28,24 +22,13 @@ function clumping_factor!(
 end
 
 
-
-
-
-
-
-
 ###############################################################################
 #
 # Update canopy geometry
 #
 ###############################################################################
 """
-    canopy_geometry!(
-                can::Canopy4RT{FT},
-                angles::SolarAngles{FT},
-                can_opt::CanopyOpticals{FT},
-                rt_con::RTCache{FT}
-    ) where {FT<:AbstractFloat}
+    canopy_geometry!(can::Canopy4RT{FT}, angles::SolarAngles{FT}, can_opt::CanopyOpticals{FT}, rt_con::RTCache{FT}) where {FT<:AbstractFloat}
 
 Computes canopy optical properties (extinction coefficients for direct and
     diffuse light) based on the SAIL model. Most important input parameters are
@@ -56,17 +39,12 @@ Computes canopy optical properties (extinction coefficients for direct and
 - `can_opt` [`CanopyOpticals`](@ref) type struct
 - `rt_con` [`RTCache`](@ref) type cache
 """
-function canopy_geometry!(
-            can::Canopy4RT{FT},
-            angles::SolarAngles{FT},
-            can_opt::CanopyOpticals{FT},
-            rt_con::RTCache{FT}
-) where {FT<:AbstractFloat}
+function canopy_geometry!(can::Canopy4RT{FT}, angles::SolarAngles{FT}, can_opt::CanopyOpticals{FT}, rt_con::RTCache{FT}) where {FT<:AbstractFloat}
     # 1. update clumping factor from zenith angle
     clumping_factor!(can, angles);
 
     # 2. update solor angle dependent variables
-    @unpack sza, vza, raa = angles;
+    (; sza, vza, raa) = angles;
     cos_vza = cosd(vza);
     tan_vza = tand(vza);
     cos_raa = cosd(raa);
@@ -79,11 +57,11 @@ function canopy_geometry!(
     psi_vol = abs( raa - 360*round(raa/360) );
 
     # 3. unpack canopy parameters
-    @unpack dx, hot, LAI, lazitab, lidf, litab, nLayer, xl, Ω = can;
+    (; dx, hot, LAI, lazitab, lidf, litab, xl, Ω) = can;
 
     # 4. update the RTCache
     can.cos_philo .= cosd.(lazitab .- raa);
-    @unpack cos_philo, cos_ttli, cos_ttlo, sin_ttli = can;
+    (; cos_philo, cos_ttli, cos_ttlo, sin_ttli) = can;
 
     # 5. calculate geometric factors associated with extinction and scattering
     can_opt.ks  = 0;
@@ -91,7 +69,7 @@ function canopy_geometry!(
     can_opt.bf  = 0;
     can_opt.sob = 0;
     can_opt.sof = 0;
-    @inbounds for i=1:length(litab)
+    @inbounds for i in eachindex(litab)
         _lit = litab[i];
         _lid = lidf[i];
         _ctl = cos_ttli[i];
@@ -122,7 +100,7 @@ function canopy_geometry!(
     end
 
     # 6. geometric factors to be used later with rho and tau
-    @unpack bf, ko, ks = can_opt;
+    (; bf, ko, ks) = can_opt;
     can_opt.sdb = (ks + bf) / 2;
     can_opt.sdf = (ks - bf) / 2;
     can_opt.dob = (ko + bf) / 2;
@@ -136,7 +114,7 @@ function canopy_geometry!(
     cg_con._Ss .= sin_ttli .* sin_sza; # [nli]
     cg_con._Co .= cos_ttli .* cos_vza; # [nli]
     cg_con._So .= sin_ttli .* sin_vza; # [nli]
-    @unpack _Co, _Cs, _So, _Ss, _1s = cg_con;
+    (; _Co, _Cs, _So, _Ss, _1s) = cg_con;
     # cg_con._cds .= _Cs * _1s .+ _Ss * cos_ttlo' ; # [nli, nlazi]
     # cg_con._cdo .= _Co * _1s .+ _So * cos_philo'; # [nli, nlazi]
     mul!(cg_con._cds, _Cs, _1s       );
@@ -145,7 +123,7 @@ function canopy_geometry!(
     mul!(cg_con._cdo, _Co, _1s       );
     mul!(cg_con._2d , _So, cos_philo');
     cg_con._cdo .+= cg_con._2d;
-    @unpack _cdo, _cds = cg_con;
+    (; _cdo, _cds) = cg_con;
 
     # 8. update fs and fo
     # This is basically equivalent to Kb in Bonan, eq. 14.21
@@ -168,7 +146,7 @@ function canopy_geometry!(
 
     # TODO minimize the allocations here
     # length(xl) * 7 allocations here!
-    @inbounds for j=1:length(xl)
+    @inbounds for j in eachindex(xl)
         can_opt.Pso[j] = quadgk(f, xl[j]-dx, xl[j], rtol=1e-2)[1] / dx;
     end
 
diff --git a/src/CanopyLayers/layers/canopymatrices.jl b/src/CanopyLayers/layers/canopymatrices.jl
index 844f4e5a..0fcc3044 100644
--- a/src/CanopyLayers/layers/canopymatrices.jl
+++ b/src/CanopyLayers/layers/canopymatrices.jl
@@ -4,10 +4,7 @@
 #
 ###############################################################################
 """
-    canopy_matrices!(
-                leaves::Array{LeafBios{FT},1},
-                can_opt::CanopyOpticals{FT}
-    ) where {FT<:AbstractFloat}
+    canopy_matrices!(leaves::Vector{LeafBios{FT}}, can_opt::CanopyOpticals{FT}) where {FT<:AbstractFloat}
 
 Compute scattering coefficient matrices for direct and diffuse light given
     geometry dependent overall extinction coefficients and pigment dependent
@@ -16,12 +13,9 @@ Compute scattering coefficient matrices for direct and diffuse light given
 - `leaves` Array of [`LeafBios`](@ref) type struct
 - `can_opt` [`CanopyOpticals`](@ref) type struct
 """
-function canopy_matrices!(
-            leaves::Array{LeafBios{FT},1},
-            can_opt::CanopyOpticals{FT}
-) where {FT<:AbstractFloat}
+function canopy_matrices!(leaves::Vector{LeafBios{FT}}, can_opt::CanopyOpticals{FT}) where {FT<:AbstractFloat}
     # 1. unpack values
-    @unpack ddb, ddf, dob, dof, sdb, sdf, sob, sof = can_opt;
+    (; ddb, ddf, dob, dof, sdb, sdf, sob, sof) = can_opt;
 
     # 2. Calculation of reflectance
     nLayer = size(can_opt.sigb)[2];
diff --git a/src/CanopyLayers/layers/diffusives.jl b/src/CanopyLayers/layers/diffusives.jl
index 997f24b8..e1f47e22 100644
--- a/src/CanopyLayers/layers/diffusives.jl
+++ b/src/CanopyLayers/layers/diffusives.jl
@@ -4,14 +4,7 @@
 #
 ###############################################################################
 """
-    diffusive_S(τ_dd::Array{FT},
-                ρ_dd::Array{FT},
-                S⁻::Array{FT},
-                S⁺::Array{FT},
-                boundary_top::Array{FT},
-                boundary_bottom::Array{FT},
-                rsoil::Array{FT}
-    ) where {FT<:AbstractFloat}
+    diffusive_S(τ_dd::Array{FT}, ρ_dd::Array{FT}, S⁻::Array{FT}, S⁺::Array{FT}, boundary_top::Array{FT}, boundary_bottom::Array{FT}, rsoil::Array{FT}) where {FT<:AbstractFloat}
 
 Computes 2-stream diffusive radiation transport (used for thermal and SIF) given:
 - `τ_dd` A 2D Array with layer reflectances
@@ -22,15 +15,7 @@ Computes 2-stream diffusive radiation transport (used for thermal and SIF) given
 - `boundary_bottom` A 1D array with upwnwelling radiation at the bottom (soil)
 - `rsoil` A 1D array with soil reflectance
 """
-function diffusive_S(
-            τ_dd::Array{FT},
-            ρ_dd::Array{FT},
-            S⁻::Array{FT},
-            S⁺::Array{FT},
-            boundary_top::Array{FT},
-            boundary_bottom::Array{FT},
-            rsoil::Array{FT}
-) where {FT<:AbstractFloat}
+function diffusive_S(τ_dd::Array{FT}, ρ_dd::Array{FT}, S⁻::Array{FT}, S⁺::Array{FT}, boundary_top::Array{FT}, boundary_bottom::Array{FT}, rsoil::Array{FT}) where {FT<:AbstractFloat}
     # Get dimensions (1st is wavelength, 2nd is layers), for Stefab Boltzmann
     # just one effective wavelength
     nWL,nl = size(τ_dd);
@@ -71,14 +56,8 @@ function diffusive_S(
 end
 
 
-
-
 """
-    diffusive_S!(
-                sf_con::SFCache{FT},
-                soil::SoilOpticals{FT},
-                rt_dim::RTDimensions
-    ) where {FT<:AbstractFloat}
+    diffusive_S!(sf_con::SFCache{FT}, soil::SoilOpticals{FT}, rt_dim::RTDimensions) where {FT<:AbstractFloat}
 
 Computes 2-stream diffusive radiation transport (used for thermal and SIF),
     given
@@ -86,16 +65,11 @@ Computes 2-stream diffusive radiation transport (used for thermal and SIF),
 - `soil` [`SoilOpticals`](@ref) type struct
 - `rt_dim` [`RTDimensions`](@ref) type struct
 """
-function diffusive_S!(
-            sf_con::SFCache{FT},
-            soil::SoilOpticals{FT},
-            rt_dim::RTDimensions
-) where {FT<:AbstractFloat}
+function diffusive_S!(sf_con::SFCache{FT}, soil::SoilOpticals{FT}, rt_dim::RTDimensions) where {FT<:AbstractFloat}
     # 1. unpack values from sf_con
-    @unpack dnorm,  F⁻, F⁺, net_diffuse, Rdd, S⁻, S⁺, U, Xdd, Y, zeroB, ρ_dd,
-            τ_dd = sf_con;
-    @unpack ρ_SW_SIF = soil;
-    @unpack nLayer, nLevel = rt_dim;
+    (; dnorm, F⁻, F⁺, net_diffuse, Rdd, S⁻, S⁺, U, Xdd, Y, zeroB, ρ_dd, τ_dd) = sf_con;
+    (; ρ_SW_SIF) = soil;
+    (; nLayer, nLevel) = rt_dim;
 
     # Get dimensions (1st is wavelength, 2nd is layers), for Stefan Boltzmann
     # just one effective wavelength
diff --git a/src/CanopyLayers/layers/fluspect.jl b/src/CanopyLayers/layers/fluspect.jl
index deef6208..b01b4d76 100644
--- a/src/CanopyLayers/layers/fluspect.jl
+++ b/src/CanopyLayers/layers/fluspect.jl
@@ -5,10 +5,7 @@
 #
 ###############################################################################
 """
-    fluspect!(leaf::LeafBios{FT},
-              wls::WaveLengths{FT};
-              APAR_car::Bool = true
-    ) where {FT<:AbstractFloat}
+    fluspect!(leaf::LeafBios{FT}, wls::WaveLengths{FT}; APAR_car::Bool = true) where {FT<:AbstractFloat}
 
 Computes leaf optical properties (reflectance and transittance) based on
     pigment concentrations. Also computes Fluorescence excitation matrices.
@@ -18,11 +15,7 @@ Computes leaf optical properties (reflectance and transittance) based on
 - `wls` [`WaveLengths`](@ref) type struct
 - `APAR_car` If true, include Car absorption in APAR for photosynthesis
 """
-function fluspect!(
-            leaf::LeafBios{FT},
-            wls::WaveLengths{FT};
-            APAR_car::Bool = true
-) where {FT<:AbstractFloat}
+function fluspect!(leaf::LeafBios{FT}, wls::WaveLengths{FT}; APAR_car::Bool = false) where {FT<:AbstractFloat}
     # ***********************************************************************
     # Jacquemoud S., Baret F. (1990), PROSPECT: a model of leaf optical
     # properties spectra; Remote Sens. Environ.; 34:75-91.
@@ -36,9 +29,9 @@ function fluspect!(
     # & used with his autorization.
     # ***********************************************************************
 
-    @unpack N, Cab, Car, Ant, Cs, Cw, Cm, ρ_SW, τ_SW, Cx, ndub = leaf;
-    @unpack iWLE, iWLF, optis, WLE, WLF = wls;
-    @unpack Kab, Kant, KBrown, KcaV, KcaZ, Km, Kw, nr, phi = optis;
+    (; N, Cab, Car, Ant, Cs, Cw, Cm, ρ_SW, τ_SW, Cx, ndub) = leaf;
+    (; iWLE, iWLF, optis, WLE, WLF) = wls;
+    (; Kab, Kant, KBrown, KcaV, KcaZ, Km, Kw, nr, phi) = optis;
 
     #println(N, " ", Cab, " ", Car," ",  Ant, " ", Cs, " ", Cw, " ", Cm)
     Kcaro = (1 - Cx) * KcaV .+ Cx * KcaZ;
@@ -53,7 +46,6 @@ function fluspect!(
     else
         leaf.kChlrel = (Cab*Kab)./(Kall*N.+eps(FT));
     end
-    leaf.kChlrel_old  = (Cab*Kab)./(Kall*N.+eps(FT));
     #println(typeof(Kall))
     # Adding eps() here to keep it stable and NOT set to 1 manually when Kall=0 (ForwardDiff won't work otherwise)
     tau = (1 .-Kall).*exp.(-Kall) .+ Kall.^2 .*real.(expint.(Kall.+eps(FT)))
@@ -70,22 +62,22 @@ function fluspect!(
     # From Prospect-D, uses 40 here instead of 59 from CVT)
 
     #talf    = calctav.(59.,nr)
-    talf    = calctav.(FT(40),nr)
-    ralf    = FT(1) .-talf
+    talf = calctav.(FT(40),nr)
+    ralf = FT(1) .-talf
 
-    t12     = calctav.(FT(90), nr)
-    r12     = FT(1) .-t12
-    t21     = t12./(nr.^2)
-    r21     = FT(1) .-t21
+    t12 = calctav.(FT(90), nr)
+    r12 = FT(1) .-t12
+    t21 = t12./(nr.^2)
+    r21 = FT(1) .-t21
     #println(typeof(r21))
     # top surface side
-    denom   = FT(1) .-r21.*r21.*tau.^2
-    Ta      = talf.*tau.*t21./denom
-    Ra      = ralf.+r21.*tau.*Ta
+    denom = FT(1) .-r21.*r21.*tau.^2
+    Ta    = talf.*tau.*t21./denom
+    Ra    = ralf.+r21.*tau.*Ta
     #println(typeof(t12), typeof(t21), typeof(denom), typeof(tau))
     # bottom surface side
-    t       = t12.*tau.*t21./denom
-    r       = r12+r21.*tau.*t
+    t = t12.*tau.*t21./denom
+    r = r12+r21.*tau.*t
 
     # ***********************************************************************
     # reflectance & transmittance of N layers
@@ -96,19 +88,19 @@ function fluspect!(
     # | transmitted through a pile of plates; Proc. Roy. Soc. Lond.
     # 11:545-556.
     # ***********************************************************************
-    D       = sqrt.((FT(1) .+r.+t).*(FT(1) .+r.-t).*(FT(1) .-r.+t).*(FT(1) .-r.-t))
+    D = sqrt.((FT(1) .+r.+t).*(FT(1) .+r.-t).*(FT(1) .-r.+t).*(FT(1) .-r.-t))
     #println(typeof(D), typeof(r), typeof(t))
-    rq      = r.^2
-    tq      = t.^2
-    a       = (FT(1) .+rq.-tq.+D)./(2r)
-    b       = (FT(1) .-rq.+tq.+D)./(2t)
-
-    bNm1    = b.^(N-1);                  #
-    bN2     = bNm1.^2
-    a2      = a.^2
-    denom   = a2.*bN2.-1
-    Rsub    = a.*(bN2.-1)./denom
-    Tsub    = bNm1.*(a2.-1)./denom
+    rq = r.^2
+    tq = t.^2
+    a  = (FT(1) .+rq.-tq.+D)./(2r)
+    b  = (FT(1) .-rq.+tq.+D)./(2t)
+
+    bNm1  = b.^(N-1);
+    bN2   = bNm1.^2
+    a2    = a.^2
+    denom = a2.*bN2.-1
+    Rsub  = a.*(bN2.-1)./denom
+    Tsub  = bNm1.*(a2.-1)./denom
 
     # Case of zero absorption
     j       = findall(r.+t .>= 1)
@@ -116,12 +108,12 @@ function fluspect!(
     Rsub[j] = 1 .-Tsub[j]
 
     # Reflectance & transmittance of the leaf: combine top layer with next N-1 layers
-    denom   = 1 .-Rsub.*r
-    leaf.τ_SW    = Ta.*Tsub./denom
-    leaf.ρ_SW    = Ra.+Ta.*Rsub.*t./denom
-    leaf.α_SW    = 1 .- leaf.τ_SW .- leaf.ρ_SW;
-    τ_SW    = leaf.τ_SW
-    ρ_SW    = leaf.ρ_SW
+    denom = 1 .-Rsub.*r
+    leaf.τ_SW = Ta.*Tsub./denom
+    leaf.ρ_SW = Ra.+Ta.*Rsub.*t./denom
+    leaf.α_SW = 1 .- leaf.τ_SW .- leaf.ρ_SW;
+    τ_SW = leaf.τ_SW
+    ρ_SW = leaf.ρ_SW
     #RT     = [refl tran]
     #
     #
@@ -152,59 +144,59 @@ function fluspect!(
     rho = tt1./tt2;      # Reflectance and transmittance
     tt1 = (1 .-Rb.*r21);
     tau = tt1./tt2.*Z;    # of the leaf mesophyll layer
-    t   =   tau;
-    r   =   max.(rho,0);                       # Avoid negative r
+    t = tau;
+    r = max.(rho,0);                       # Avoid negative r
 
     # Derive Kubelka-Munk s and k
-    I_rt     =   findall((r.+t).<1);
-    D[I_rt]  =   sqrt.((1 .+ r[I_rt] .+ t[I_rt]) .* (1 .+ r[I_rt] .- t[I_rt]) .* (1 .- r[I_rt] .+ t[I_rt]) .*  (1 .- r[I_rt] .- t[I_rt]));
-    a[I_rt]  =   (1 .+ r[I_rt].^2 .- t[I_rt].^2 .+ D[I_rt]) ./ (2r[I_rt]);
-    b[I_rt]  =   (1 .- r[I_rt].^2 + t[I_rt].^2 .+ D[I_rt]) ./ (2t[I_rt]);
-    a[(r.+t).>=1] .=   FT(1.0);
-    b[(r.+t).>=1] .=   FT(1.0);
+    I_rt    = findall((r.+t).<1);
+    D[I_rt] = sqrt.((1 .+ r[I_rt] .+ t[I_rt]) .* (1 .+ r[I_rt] .- t[I_rt]) .* (1 .- r[I_rt] .+ t[I_rt]) .*  (1 .- r[I_rt] .- t[I_rt]));
+    a[I_rt] = (1 .+ r[I_rt].^2 .- t[I_rt].^2 .+ D[I_rt]) ./ (2r[I_rt]);
+    b[I_rt] = (1 .- r[I_rt].^2 + t[I_rt].^2 .+ D[I_rt]) ./ (2t[I_rt]);
+    a[(r.+t).>=1] .= FT(1);
+    b[(r.+t).>=1] .= FT(1);
 
-    s        =   r./t;
-    I_a      =   findall((a.>1).&(a.!=Inf));
-    s[I_a]   =   2 .*a[I_a] ./ (a[I_a].^2 .- 1) .* log.(b[I_a]);
+    s      = r./t;
+    I_a    = findall((a.>1).&(a.!=Inf));
+    s[I_a] = 2 .*a[I_a] ./ (a[I_a].^2 .- 1) .* log.(b[I_a]);
 
-    k        =   log.(b);
-    k[I_a]   =   (a[I_a].-1) ./ (a[I_a].+1) .* log.(b[I_a]);
-    kChl     =   leaf.kChlrel .* k;
+    k      = log.(b);
+    k[I_a] = (a[I_a].-1) ./ (a[I_a].+1) .* log.(b[I_a]);
+    kChl   = leaf.kChlrel .* k;
 
     # indices of WLE and WLF within wlp
 
-    epsi         = FT(2)^(-ndub);
+    epsi = FT(2)^(-ndub);
 
     # initialisations
-    te     = 1 .-(k[iWLE].+s[iWLE]) * epsi;
-    tf     = 1 .-(k[iWLF].+s[iWLF]) * epsi;
-    re     = s[iWLE] * epsi;
-    rf     = s[iWLF] * epsi;
+    te = 1 .-(k[iWLE].+s[iWLE]) * epsi;
+    tf = 1 .-(k[iWLF].+s[iWLF]) * epsi;
+    re = s[iWLE] * epsi;
+    rf = s[iWLF] * epsi;
 
-    sigmoid     = 1 ./(1 .+exp.(-WLF/10).*exp.(WLE'/10));  # matrix computed as an outproduct
+    sigmoid = 1 ./(1 .+exp.(-WLF/10).*exp.(WLE'/10));  # matrix computed as an outproduct
     #println(size(sigmoid)," ", size(phi), " ", size(kChl)," ", size(iWLE), " ", size(iWLF), " ", size(kChl[iWLE]))
 
     Mf = leaf.fqe .* ((FT(0.5)*phi[iWLF]).*epsi) .* kChl[iWLE]'.*sigmoid
     Mb = leaf.fqe .* ((FT(0.5)*phi[iWLF]).*epsi) .* kChl[iWLE]'.*sigmoid
 
-    Ih          = ones(FT,1,length(te));     # row of ones
-    Iv          = ones(FT,length(tf),1);     # column of ones
+    Ih = ones(FT,1,length(te));     # row of ones
+    Iv = ones(FT,length(tf),1);     # column of ones
 
     # Doubling Adding Routine
     for i = 1:ndub
-        xe = te./(1 .-re.*re);  ten = te.*xe;  ren = re.*(1 .+ten);
-        xf = tf./(1 .-rf.*rf);  tfn = tf.*xf;  rfn = rf.*(1 .+tfn);
+        xe = te./(1 .-re.*re); ten = te.*xe; ren = re.*(1 .+ten);
+        xf = tf./(1 .-rf.*rf); tfn = tf.*xf; rfn = rf.*(1 .+tfn);
 
-        A11  = xf*Ih + Iv*xe';
+        A11 = xf*Ih + Iv*xe';
         A12 = (xf*xe').*(rf*Ih .+ Iv*re');
-        A21  = 1 .+(xf*xe').*(1 .+rf*re');
+        A21 = 1 .+(xf*xe').*(1 .+rf*re');
         A22 = (xf.*rf)*Ih+Iv*adjoint(xe.*re);
         #println(typeof(opti.phi), typeof(kChl), typeof(Mf))
-        Mfn   = Mf  .* A11 .+ Mb  .* A12;
-        Mbn   = Mb  .* A21 .+ Mf  .* A22;
+        Mfn = Mf .* A11 .+ Mb .* A12;
+        Mbn = Mb .* A21 .+ Mf .* A22;
 
-        te   = ten;  re  = ren;   tf   = tfn;   rf   = rfn;
-        Mf  = Mfn; Mb = Mbn;
+        te = ten; re = ren; tf = tfn; rf = rfn;
+        Mf = Mfn; Mb = Mbn;
     end
     # Here we add the leaf-air interfaces again for obtaining the final
     # leaf level fluorescences.
@@ -225,8 +217,19 @@ function fluspect!(
     gn = A .* g + B .* f;
     fn = A .* f + B .* g;
 
-    leaf.Mb  = gn;
-    leaf.Mf  = fn;
+    leaf.Mb = gn;
+    leaf.Mf = fn;
+
+    # use the prescribed leaf reflectance at PAR and NIR ranges
+    # we changed it here rather than at the beginning because we need to use the SIF matrices
+    if leaf.prescribe
+        leaf.ρ_SW[wls.iPAR] .= leaf.ρs[1];
+        leaf.τ_SW[wls.iPAR] .= leaf.τs[1];
+        leaf.ρ_SW[wls.iNIR] .= leaf.ρs[2];
+        leaf.τ_SW[wls.iNIR] .= leaf.τs[2];
+        leaf.α_SW .= 1 .- leaf.τ_SW .- leaf.ρ_SW;
+        leaf.kChlrel .= 1;
+    end;
 
     return nothing
 end
diff --git a/src/CanopyLayers/layers/indicies.jl b/src/CanopyLayers/layers/indicies.jl
index d79ea813..21162f88 100644
--- a/src/CanopyLayers/layers/indicies.jl
+++ b/src/CanopyLayers/layers/indicies.jl
@@ -4,37 +4,25 @@
 #
 ###############################################################################
 """
-    BLUE(can_rad::CanopyRads{FT},
-         wls::WaveLengths{FT}
-    ) where {FT<:AbstractFloat}
+    BLUE(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
 
 Return the BLUE @ 469 nm, given
 - `can_rad` [`CanopyRads`](@ref) type struct
 - `wls` [`WaveLengths`](@ref) type struct
 """
-function BLUE(
-            can_rad::CanopyRads{FT},
-            wls::WaveLengths{FT}
-) where {FT<:AbstractFloat}
+function BLUE(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
     return REF_WL(can_rad, wls, FT(469))
 end
 
 
-
-
 """
-    EVI(can_rad::CanopyRads{FT},
-        wls::WaveLengths{FT}
-    ) where {FT<:AbstractFloat}
+    EVI(can_rad::CanopyRads{FT},wls::WaveLengths{FT}) where {FT<:AbstractFloat}
 
 Return the EVI, given
 - `can_rad` [`CanopyRads`](@ref) type struct
 - `wls` [`WaveLengths`](@ref) type struct
 """
-function EVI(
-            can_rad::CanopyRads{FT},
-            wls::WaveLengths{FT}
-) where {FT<:AbstractFloat}
+function EVI(can_rad::CanopyRads{FT},wls::WaveLengths{FT}) where {FT<:AbstractFloat}
     _BLUE = BLUE(can_rad, wls);
     _NIR  = NIR(can_rad, wls);
     _RED  = RED(can_rad, wls);
@@ -43,21 +31,14 @@ function EVI(
 end
 
 
-
-
 """
-    EVI2(can_rad::CanopyRads{FT},
-        wls::WaveLengths{FT}
-    ) where {FT<:AbstractFloat}
+    EVI2(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
 
 Return the EVI2, given
 - `can_rad` [`CanopyRads`](@ref) type struct
 - `wls` [`WaveLengths`](@ref) type struct
 """
-function EVI2(
-            can_rad::CanopyRads{FT},
-            wls::WaveLengths{FT}
-) where {FT<:AbstractFloat}
+function EVI2(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
     _BLUE = BLUE(can_rad, wls);
     _NIR  = NIR(can_rad, wls);
     _RED  = RED(can_rad, wls);
@@ -66,46 +47,31 @@ function EVI2(
 end
 
 
-
-
 """
-    LSWI(can_rad::CanopyRads{FT},
-         wls::WaveLengths{FT}
-    ) where {FT<:AbstractFloat}
+    LSWI(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
 
 Return the LSWI, given
 - `can_rad` [`CanopyRads`](@ref) type struct
 - `wls` [`WaveLengths`](@ref) type struct
 """
-function LSWI(
-            can_rad::CanopyRads{FT},
-            wls::WaveLengths{FT}
-) where {FT<:AbstractFloat}
+function LSWI(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
     _BLUE = BLUE(can_rad, wls);
     _NIR  = NIR(can_rad, wls);
     _RED  = RED(can_rad, wls);
     _SWIR = SWIR(can_rad, wls);
 
-
     return (_NIR - _SWIR) / (_NIR + _SWIR)
 end
 
 
-
-
 """
-    NDVI(can_rad::CanopyRads{FT},
-         wls::WaveLengths{FT}
-    ) where {FT<:AbstractFloat}
+    NDVI(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
 
 Return the NDVI, given
 - `can_rad` [`CanopyRads`](@ref) type struct
 - `wls` [`WaveLengths`](@ref) type struct
 """
-function NDVI(
-            can_rad::CanopyRads{FT},
-            wls::WaveLengths{FT}
-) where {FT<:AbstractFloat}
+function NDVI(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
     _NIR = NIR(can_rad, wls);
     _RED = RED(can_rad, wls);
 
@@ -113,40 +79,26 @@ function NDVI(
 end
 
 
-
-
 """
-    NIR(can_rad::CanopyRads{FT},
-        wls::WaveLengths{FT}
-    ) where {FT<:AbstractFloat}
+    NIR(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
 
 Return the NIR @ 858.5 nm, given
 - `can_rad` [`CanopyRads`](@ref) type struct
 - `wls` [`WaveLengths`](@ref) type struct
 """
-function NIR(
-            can_rad::CanopyRads{FT},
-            wls::WaveLengths{FT}
-) where {FT<:AbstractFloat}
+function NIR(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
     return REF_WL(can_rad, wls, FT(858.5))
 end
 
 
-
-
 """
-    NIRv(can_rad::CanopyRads{FT},
-         wls::WaveLengths{FT}
-    ) where {FT<:AbstractFloat}
+    NIRv(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
 
 Return the NIRv, given
 - `can_rad` [`CanopyRads`](@ref) type struct
 - `wls` [`WaveLengths`](@ref) type struct
 """
-function NIRv(
-            can_rad::CanopyRads{FT},
-            wls::WaveLengths{FT}
-) where {FT<:AbstractFloat}
+function NIRv(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
     _NIR = NIR(can_rad, wls);
     _RED = RED(can_rad, wls);
 
@@ -154,21 +106,14 @@ function NIRv(
 end
 
 
-
-
 """
-    NIRvES(can_rad::CanopyRads{FT},
-           wls::WaveLengths{FT}
-    ) where {FT<:AbstractFloat}
+    NIRvES(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
 
 Return the NIRv from the energy spectrum, given
 - `can_rad` [`CanopyRads`](@ref) type struct
 - `wls` [`WaveLengths`](@ref) type struct
 """
-function NIRvES(
-            can_rad::CanopyRads{FT},
-            wls::WaveLengths{FT}
-) where {FT<:AbstractFloat}
+function NIRvES(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
     _NIR = SPECTRUM_WL(can_rad.Lo, wls, FT(858.5));
     _RED = SPECTRUM_WL(can_rad.Lo, wls, FT(645));
 
@@ -176,46 +121,29 @@ function NIRvES(
 end
 
 
-
-
 """
-    RED(can_rad::CanopyRads{FT},
-        wls::WaveLengths{FT}
-    ) where {FT<:AbstractFloat}
+    RED(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
 
 Return the RED @ 645 nm, given
 - `can_rad` [`CanopyRads`](@ref) type struct
 - `wls` [`WaveLengths`](@ref) type struct
 """
-function RED(
-            can_rad::CanopyRads{FT},
-            wls::WaveLengths{FT}
-) where {FT<:AbstractFloat}
+function RED(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
     return REF_WL(can_rad, wls, FT(645))
 end
 
 
-
-
 """
-    REF_WL(wls::WaveLengths{FT},
-           can_rad::CanopyRads{FT}
-           wls::WaveLengths{FT},
-           twl::FT
-    ) where {FT<:AbstractFloat}
+    REF_WL(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}, twl::FT) where {FT<:AbstractFloat}
 
 Return the Reflectance, given
 - `can_rad` [`CanopyRads`](@ref) type struct
 - `wls` [`WaveLengths`](@ref) type struct
 - `twl` Target wave length in nm
 """
-function REF_WL(
-            can_rad::CanopyRads{FT},
-            wls::WaveLengths{FT},
-            twl::FT
-) where {FT<:AbstractFloat}
-    @unpack WL,nWL = wls;
-    @unpack alb_obs = can_rad;
+function REF_WL(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}, twl::FT) where {FT<:AbstractFloat}
+    (; WL, nWL) = wls;
+    (; alb_obs) = can_rad;
 
     # find the index where twl nm is
     ind = 0;
@@ -231,32 +159,21 @@ function REF_WL(
         @warn "target wave length out of bounds, please check the set up!";
         return FT(NaN)
     else
-        return (WL[ind+1] - twl) / (WL[ind+1] - WL[ind]) * alb_obs[ind] +
-               (twl - WL[ind]) / (WL[ind+1] - WL[ind]) * alb_obs[ind+1]
+        return (WL[ind+1] - twl) / (WL[ind+1] - WL[ind]) * alb_obs[ind] + (twl - WL[ind]) / (WL[ind+1] - WL[ind]) * alb_obs[ind+1]
     end
 end
 
 
-
-
 """
-    SPECTRUM_WL(wls::WaveLengths{FT},
-           can_rad::CanopyRads{FT}
-           wls::WaveLengths{FT},
-           twl::FT
-    ) where {FT<:AbstractFloat}
+    SPECTRUM_WL(spectrum::Vector{FT}, wls::WaveLengths{FT}, twl::FT) where {FT<:AbstractFloat}
 
 Return the Reflectance, given
 - `can_rad` [`CanopyRads`](@ref) type struct
 - `wls` [`WaveLengths`](@ref) type struct
 - `twl` Target wave length in nm
 """
-function SPECTRUM_WL(
-            spectrum::Vector{FT},
-            wls::WaveLengths{FT},
-            twl::FT
-) where {FT<:AbstractFloat}
-    @unpack WL,nWL = wls;
+function SPECTRUM_WL(spectrum::Vector{FT}, wls::WaveLengths{FT}, twl::FT) where {FT<:AbstractFloat}
+    (; WL, nWL) = wls;
 
     # find the index where twl nm is
     ind = 0;
@@ -272,61 +189,39 @@ function SPECTRUM_WL(
         @warn "target wave length out of bounds, please check the set up!";
         return FT(NaN)
     else
-        return (WL[ind+1] - twl) / (WL[ind+1] - WL[ind]) * spectrum[ind] +
-               (twl - WL[ind]) / (WL[ind+1] - WL[ind]) * spectrum[ind+1]
+        return (WL[ind+1] - twl) / (WL[ind+1] - WL[ind]) * spectrum[ind] + (twl - WL[ind]) / (WL[ind+1] - WL[ind]) * spectrum[ind+1]
     end
 end
 
 
-
-
 """
-    SWIR(can_rad::CanopyRads{FT},
-        wls::WaveLengths{FT}
-    ) where {FT<:AbstractFloat}
+    SWIR(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
 
 Return the SWIR @ 2130 nm, given
 - `can_rad` [`CanopyRads`](@ref) type struct
 - `wls` [`WaveLengths`](@ref) type struct
 """
-function SWIR(
-            can_rad::CanopyRads{FT},
-            wls::WaveLengths{FT}
-) where {FT<:AbstractFloat}
+function SWIR(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
     return REF_WL(can_rad, wls, FT(2130))
 end
 
 
-
-
-
-
-
-
 ###############################################################################
 #
 # SIF related
 #
 ###############################################################################
 """
-    SIF_WL(wls::WaveLengths{FT},
-           can_rad::CanopyRads{FT}
-           wls::WaveLengths{FT},
-           twl::FT
-    ) where {FT<:AbstractFloat}
+    SIF_WL(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}, twl::FT) where {FT<:AbstractFloat}
 
 Return the SIF, given
 - `can_rad` [`CanopyRads`](@ref) type struct
 - `wls` [`WaveLengths`](@ref) type struct
 - `twl` Target SIF wave length in nm
 """
-function SIF_WL(
-            can_rad::CanopyRads{FT},
-            wls::WaveLengths{FT},
-            twl::FT
-) where {FT<:AbstractFloat}
-    @unpack WLF,nWLF = wls;
-    @unpack SIF_obs = can_rad;
+function SIF_WL(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}, twl::FT) where {FT<:AbstractFloat}
+    (; WLF, nWLF) = wls;
+    (; SIF_obs) = can_rad;
 
     # find the index where twl nm is
     ind = 0;
@@ -342,68 +237,44 @@ function SIF_WL(
         @warn "target wave length out of bounds, please check the set up!";
         return FT(NaN)
     else
-        return (WLF[ind+1] - twl) / (WLF[ind+1] - WLF[ind]) * SIF_obs[ind] +
-               (twl - WLF[ind]) / (WLF[ind+1] - WLF[ind]) * SIF_obs[ind+1]
+        return (WLF[ind+1] - twl) / (WLF[ind+1] - WLF[ind]) * SIF_obs[ind] + (twl - WLF[ind]) / (WLF[ind+1] - WLF[ind]) * SIF_obs[ind+1]
     end
 end
 
 
-
-
 """
-    SIF_683(can_rad::CanopyRads{FT},
-            wls::WaveLengths{FT}
-    ) where {FT<:AbstractFloat}
+    SIF_683(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
 
 Return the SIF @ 682.5 nm, given
 - `can_rad` [`CanopyRads`](@ref) type struct
 - `wls` [`WaveLengths`](@ref) type struct
 """
-function SIF_683(
-            can_rad::CanopyRads{FT},
-            wls::WaveLengths{FT}
-) where {FT<:AbstractFloat}
+function SIF_683(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
     return SIF_WL(can_rad, wls, FT(682.5))
 end
 
 
-
-
 """
-    SIF_740(can_rad::CanopyRads{FT},
-            wls::WaveLengths{FT}
-    ) where {FT<:AbstractFloat}
+    SIF_740(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
 
 Return the SIF @ 740 nm, given
 - `can_rad` [`CanopyRads`](@ref) type struct
 - `wls` [`WaveLengths`](@ref) type struct
 """
-function SIF_740(
-            can_rad::CanopyRads{FT},
-            wls::WaveLengths{FT}
-) where {FT<:AbstractFloat}
+function SIF_740(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}) where {FT<:AbstractFloat}
     return SIF_WL(can_rad, wls, FT(740))
 end
 
 
-
-
 """
-    SIF_757(can_rad::CanopyRads{FT},
-            wls::WaveLengths{FT};
-            oco::Int = 2
-    ) where {FT<:AbstractFloat}
+    SIF_757(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}; oco::Int = 2) where {FT<:AbstractFloat}
 
 Return the SIF @ 758.68 (OCO2) or 758.77 (OCO3) nm, given
 - `can_rad` [`CanopyRads`](@ref) type struct
 - `wls` [`WaveLengths`](@ref) type struct
 - `oco` Integer to indentify OCO2 or OCO3
 """
-function SIF_757(
-            can_rad::CanopyRads{FT},
-            wls::WaveLengths{FT};
-            oco::Int = 2
-) where {FT<:AbstractFloat}
+function SIF_757(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}; oco::Int = 2) where {FT<:AbstractFloat}
     @assert 2 <= oco <= 3;
     if oco == 2
         return SIF_WL(can_rad, wls, FT(758.68))
@@ -413,24 +284,15 @@ function SIF_757(
 end
 
 
-
-
 """
-    SIF_771(can_rad::CanopyRads{FT},
-            wls::WaveLengths{FT};
-            oco::Int = 2
-    ) where {FT<:AbstractFloat}
+    SIF_771(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}; oco::Int = 2) where {FT<:AbstractFloat}
 
 Return the SIF @ 769.94 (OCO2) or 770.005 (OCO3) nm, given
 - `can_rad` [`CanopyRads`](@ref) type struct
 - `wls` [`WaveLengths`](@ref) type struct
 - `oco` Integer to indentify OCO2 or OCO3
 """
-function SIF_771(
-            can_rad::CanopyRads{FT},
-            wls::WaveLengths{FT};
-            oco::Int = 2
-) where {FT<:AbstractFloat}
+function SIF_771(can_rad::CanopyRads{FT}, wls::WaveLengths{FT}; oco::Int = 2) where {FT<:AbstractFloat}
     @assert 2 <= oco <= 3;
     if oco == 2
         return SIF_WL(can_rad, wls, FT(769.94))
diff --git a/src/CanopyLayers/layers/leaf.jl b/src/CanopyLayers/layers/leaf.jl
index 9104efbc..aadbd67b 100644
--- a/src/CanopyLayers/layers/leaf.jl
+++ b/src/CanopyLayers/layers/leaf.jl
@@ -4,11 +4,7 @@
 #
 ###############################################################################
 """
-    leaf_fluxes(leaf::LeafBios{FT},
-                in_rad::IncomingRadiation{FT},
-                wls::WaveLengths{FT},
-                rt_con::RTCache{FT}
-    ) where {FT<:AbstractFloat}
+    leaf_fluxes(leaf::LeafBios{FT}, in_rad::IncomingRadiation{FT}, wls::WaveLengths{FT}, rt_con::RTCache{FT}) where {FT<:AbstractFloat}
 
 Return leaf PAR and APAR, given
 - `leaf` [`LeafBios`](@ref) type struct
@@ -19,14 +15,9 @@ Return leaf PAR and APAR, given
 Note that `in_rad` assumes direct light with zenith angle of 0, and a zenith
     angle correction needs to be made before passing it to this function.
 """
-function leaf_fluxes(
-            leaf::LeafBios{FT},
-            in_rad::IncomingRadiation{FT},
-            wls::WaveLengths{FT},
-            rt_con::RTCache{FT}
-) where {FT<:AbstractFloat}
+function leaf_fluxes(leaf::LeafBios{FT}, in_rad::IncomingRadiation{FT}, wls::WaveLengths{FT}, rt_con::RTCache{FT}) where {FT<:AbstractFloat}
     # unpack variables
-    @unpack dWL_iPAR, iPAR, WL_iPAR = wls;
+    (; dWL_iPAR, iPAR, WL_iPAR) = wls;
     cf_con = rt_con.cf_con;
     cf_con.kChlrel .= view(leaf.kChlrel, iPAR);
 
@@ -43,8 +34,8 @@ function leaf_fluxes(
     cf_con.PAR_dirCab  .= cf_con.kChlrel .* cf_con.PAR_dir;
 
     # toral PAR and APAR
-    _dif    = numerical∫(cf_con.PAR_diff   , dWL_iPAR);
-    _dir    = numerical∫(cf_con.PAR_dir    , dWL_iPAR);
+    _dif = numerical∫(cf_con.PAR_diff, dWL_iPAR);
+    _dir = numerical∫(cf_con.PAR_dir , dWL_iPAR);
     _difCab = numerical∫(cf_con.PAR_diffCab, dWL_iPAR);
     _dirCab = numerical∫(cf_con.PAR_dirCab , dWL_iPAR);
 
diff --git a/src/CanopyLayers/layers/shortwave.jl b/src/CanopyLayers/layers/shortwave.jl
index 6c60717d..e9af607e 100644
--- a/src/CanopyLayers/layers/shortwave.jl
+++ b/src/CanopyLayers/layers/shortwave.jl
@@ -4,13 +4,7 @@
 #
 ###############################################################################
 """
-    short_wave!(can::Canopy4RT{FT},
-                can_opt::CanopyOpticals{FT},
-                can_rad::CanopyRads{FT},
-                in_rad::IncomingRadiation{FT},
-                soil::SoilOpticals{FT},
-                rt_con::RTCache{FT}
-    ) where {FT<:AbstractFloat}
+    short_wave!(can::Canopy4RT{FT}, can_opt::CanopyOpticals{FT}, can_rad::CanopyRads{FT}, in_rad::IncomingRadiation{FT}, soil::SoilOpticals{FT}, rt_con::RTCache{FT}) where {FT<:AbstractFloat}
 
 Simulate the short wave radiation through the canopy, given
 - `can` [`Canopy4RT`](@ref) type struct
@@ -20,18 +14,11 @@ Simulate the short wave radiation through the canopy, given
 - `soil` [`SoilOpticals`](@ref) type struct
 - `rt_con` [`RTCache`](@ref) type cache
 """
-function short_wave!(
-            can::Canopy4RT{FT},
-            can_opt::CanopyOpticals{FT},
-            can_rad::CanopyRads{FT},
-            in_rad::IncomingRadiation{FT},
-            soil::SoilOpticals{FT},
-            rt_con::RTCache{FT}
-) where {FT<:AbstractFloat}
+function short_wave!(can::Canopy4RT{FT}, can_opt::CanopyOpticals{FT}, can_rad::CanopyRads{FT}, in_rad::IncomingRadiation{FT}, soil::SoilOpticals{FT}, rt_con::RTCache{FT}) where {FT<:AbstractFloat}
     # unpack values from can and soil
-    @unpack LAI, nLayer, Ω = can;
-    @unpack ks, sb, sf, sigb = can_opt;
-    @unpack ρ_SW = soil;
+    (; LAI, nLayer, Ω) = can;
+    (; ks, sb, sf, sigb) = can_opt;
+    (; ρ_SW) = soil;
     sw_con = rt_con.sw_con;
 
     # 1. define some useful parameters
@@ -46,7 +33,7 @@ function short_wave!(
     sw_con.τ_sd .= sf   .* iLAI;
     sw_con.ρ_dd .= sigb .* iLAI;
     sw_con.ρ_sd .= sb   .* iLAI;
-    @unpack ρ_dd, ρ_sd, τ_dd, τ_sd = sw_con;
+    (; ρ_dd, ρ_sd, τ_dd, τ_sd) = sw_con;
 
     # 3. reflectance calculation
     # 3.1 Eq. 18 in mSCOPE paper
@@ -58,24 +45,11 @@ function short_wave!(
 
     # 3.3 reflectance for each layer from bottom to top
     @inbounds for j in nLayer:-1:1
-        sw_con.dnorm      .= 1 .-
-                             view(ρ_dd, :, j) .*
-                             view(can_opt.R_dd, :, j+1);
-        can_opt.Xsd[:,j]  .= ( view(τ_sd, :, j) .+
-                               Xss .* view(can_opt.R_sd, :, j+1) .*
-                                      view(ρ_dd, :, j) ) ./
-                             sw_con.dnorm;
+        sw_con.dnorm      .= 1 .- view(ρ_dd, :, j) .* view(can_opt.R_dd, :, j+1);
+        can_opt.Xsd[:,j]  .= ( view(τ_sd, :, j) .+ Xss .* view(can_opt.R_sd, :, j+1) .* view(ρ_dd, :, j) ) ./ sw_con.dnorm;
         can_opt.Xdd[:,j]  .= view(τ_dd, :, j) ./ sw_con.dnorm;
-        can_opt.R_sd[:,j] .= view(ρ_sd, :, j) .+
-                             view(τ_dd, :, j) .*
-                                ( view(can_opt.R_sd, :, j+1) .*
-                                  Xss .+
-                                  view(can_opt.R_dd, :, j+1) .*
-                                  view(can_opt.Xsd , :, j  ) );
-        can_opt.R_dd[:,j] .= view(ρ_dd        , :, j  ) .+
-                             view(τ_dd        , :, j  ) .*
-                             view(can_opt.R_dd, :, j+1) .*
-                             view(can_opt.Xdd , :, j  );
+        can_opt.R_sd[:,j] .= view(ρ_sd, :, j) .+ view(τ_dd, :, j) .* ( view(can_opt.R_sd, :, j+1) .* Xss .+ view(can_opt.R_dd, :, j+1) .* view(can_opt.Xsd , :, j) );
+        can_opt.R_dd[:,j] .= view(ρ_dd, :, j) .+ view(τ_dd, :, j) .* view(can_opt.R_dd, :, j+1) .* view(can_opt.Xdd , :, j);
     end
 
     # 4. flux profile calculation
@@ -86,64 +60,44 @@ function short_wave!(
 
     # 4.2 from top to bottom
     @inbounds for j=1:nLayer
-        can_rad.netSW_sunlit[:,j] .= view(can_opt.Es_   , :, j) .*
-                                     ( 1 .- (τ_ss .+ view(τ_sd, :, j) .+
-                                     view(ρ_sd          , :, j)) );
-        can_opt.Es_[:,j+1]        .= Xss .*
-                                     view(can_opt.Es_   , :, j);
-        can_rad.E_down[:,j+1]     .= view(can_opt.Xsd   , :, j) .*
-                                     view(can_opt.Es_   , :, j) .+
-                                     view(can_opt.Xdd   , :, j) .*
-                                     view(can_rad.E_down, :, j);
-        can_rad.E_up[:,j]         .= view(can_opt.R_sd  , :, j) .*
-                                     view(can_opt.Es_   , :, j) .+
-                                     view(can_opt.R_dd  , :, j) .*
-                                     view(can_rad.E_down, :, j);
+        can_rad.netSW_sunlit[:,j] .= view(can_opt.Es_ , :, j) .* ( 1 .- (τ_ss .+ view(τ_sd, :, j) .+ view(ρ_sd, :, j)) );
+        can_opt.Es_[:,j+1]        .= Xss .* view(can_opt.Es_, :, j);
+        can_rad.E_down[:,j+1]     .= view(can_opt.Xsd, :, j) .* view(can_opt.Es_, :, j) .+ view(can_opt.Xdd, :, j) .* view(can_rad.E_down, :, j);
+        can_rad.E_up[:,j]         .= view(can_opt.R_sd, :, j) .* view(can_opt.Es_, :, j) .+ view(can_opt.R_dd, :, j) .* view(can_rad.E_down, :, j);
     end
 
     # 4.3 Boundary condition at the bottom, soil reflectance (Lambertian here)
     last_ind_co = lastindex(can_opt.R_sd, 2);
-    can_rad.E_up[:,end] .= view(can_opt.R_sd  , :, last_ind_co) .*
-                           view(can_opt.Es_   , :, last_ind_co) .+
-                           view(can_opt.R_dd  , :, last_ind_co) .*
-                           view(can_rad.E_down, :, last_ind_co);
+    can_rad.E_up[:,end] .= view(can_opt.R_sd, :, last_ind_co) .* view(can_opt.Es_, :, last_ind_co) .+ view(can_opt.R_dd, :, last_ind_co) .* view(can_rad.E_down, :, last_ind_co);
 
     # 4.4 Hemispheric total outgoing
     can_rad.Eout .= view(can_rad.E_up, :, 1);
 
     # 4.5 compute net diffuse radiation per layer:
     @inbounds for j in 1:nLayer
-        can_rad.netSW_shade[:,j] .= ( view(can_rad.E_down, :, j) .+
-                                      view(can_rad.E_up, :, j+1) ) .*
-                                    ( 1 .- ( view(τ_dd, :, j) .+
-                                             view(ρ_dd, :, j) ) );
+        can_rad.netSW_shade[:,j] .= ( view(can_rad.E_down, :, j) .+ view(can_rad.E_up, :, j+1) ) .* ( 1 .- ( view(τ_dd, :, j) .+ view(ρ_dd, :, j) ) );
         # Add diffuse radiation to direct radiation as well:
         #can_rad.netSW_sunlit[:,j] += can_rad.netSW_shade[:,j]
     end
 
     # 4.6 outgoing in viewing direction
     # From Canopy
-    sw_con.piLoc2 .= can_opt.vb .* view(can_opt.Po       , 1:nLayer)' .*
-                                   view(can_rad.E_down, :, 1:nLayer)  .+
-                     can_opt.vf .* view(can_opt.Po       , 1:nLayer)' .*
-                                   view(can_rad.E_up  , :, 1:nLayer)  .+
-                     can_opt.w  .* view(can_opt.Pso      , 1:nLayer)' .*
-                                   in_rad.E_direct;
+    sw_con.piLoc2 .= can_opt.vb .* view(can_opt.Po, 1:nLayer)' .* view(can_rad.E_down, :, 1:nLayer)  .+
+                     can_opt.vf .* view(can_opt.Po, 1:nLayer)' .* view(can_rad.E_up, :, 1:nLayer)  .+
+                     can_opt.w  .* view(can_opt.Pso, 1:nLayer)' .* in_rad.E_direct;
     #sw_con.piLoc  .= iLAI .* view(sum(sw_con.piLoc2, dims=2), :, 1);
     @inbounds for j in eachindex(sw_con.piLoc)
         sw_con.piLoc[j] = iLAI * sum( view(sw_con.piLoc2, j, :) );
     end
 
     # 4.7 From Soil
-    sw_con.piLos .= view(can_rad.E_up, :, last_ind_co) .*
-                    can_opt.Po[end];
+    sw_con.piLos .= view(can_rad.E_up, :, last_ind_co) .* can_opt.Po[end];
     sw_con.piLo  .= sw_con.piLoc .+ sw_con.piLos;
     can_rad.Lo   .= sw_con.piLo ./ pi;
 
     # 4.8 Save albedos (hemispheric direct and diffuse and directional (obs))
     # rso and rdo are not computed separately
-    can_rad.alb_obs     .= sw_con.piLo ./ ( in_rad.E_direct .+
-                                            in_rad.E_diffuse );
+    can_rad.alb_obs     .= sw_con.piLo ./ ( in_rad.E_direct .+ in_rad.E_diffuse );
     can_rad.alb_direct  .= view(can_opt.R_sd, :, 1);
     can_rad.alb_diffuse .= view(can_opt.R_dd, :, 1);
 
diff --git a/src/CanopyLayers/layers/siffluxes.jl b/src/CanopyLayers/layers/siffluxes.jl
index d2d58cf4..bbb2eda2 100644
--- a/src/CanopyLayers/layers/siffluxes.jl
+++ b/src/CanopyLayers/layers/siffluxes.jl
@@ -4,7 +4,7 @@
 #
 ###############################################################################
 """
-    SIF_fluxes!(leaves::Array{LeafBios{FT},1},
+    SIF_fluxes!(leaves::Vector{LeafBios{FT}},
                 can_opt::CanopyOpticals{FT},
                 can_rad::CanopyRads{FT},
                 can::Canopy4RT{FT},
@@ -32,7 +32,7 @@ Computes 2-stream diffusive radiation transport for SIF radiation (calls
 
 """
 function SIF_fluxes!(
-            leaves::Array{LeafBios{FT},1},
+            leaves::Vector{LeafBios{FT}},
             can_opt::CanopyOpticals{FT},
             can_rad::CanopyRads{FT},
             can::Canopy4RT{FT},
@@ -43,11 +43,11 @@ function SIF_fluxes!(
             photon::Bool = true
 ) where {FT<:AbstractFloat}
     # unpack variables from structures
-    @unpack LAI, lidf, nLayer, Ω = can;
-    @unpack a, absfo, absfs, absfsfo, cosΘ_l, cos2Θ_l, fo, fs, fsfo, Po, Ps, Pso, sigb, vb, vf = can_opt;
-    @unpack E_down, E_up, ϕ_shade, ϕ_sun = can_rad;
-    @unpack ρ_SW_SIF = soil;
-    @unpack dWL_iWLE, iWLE, iWLF, WLE, WLF = wls;
+    (; LAI, lidf, nLayer, Ω) = can;
+    (; a, absfo, absfs, absfsfo, cosΘ_l, cos2Θ_l, fo, fs, fsfo, Po, Ps, Pso, sigb, vb, vf) = can_opt;
+    (; E_down, E_up, ϕ_shade, ϕ_sun) = can_rad;
+    (; ρ_SW_SIF) = soil;
+    (; dWL_iWLE, iWLE, iWLF, WLE, WLF) = wls;
     sf_con = rt_con.sf_con;
 
     # 1. define some useful parameters
@@ -131,8 +131,7 @@ function SIF_fluxes!(
         mul!(sf_con.ϕ_cosΘ_lidf, adjoint(sf_con.ϕ_cosΘ), lidf);
         _mean_fsfo = mean(sf_con.ϕ_cosΘ_lidf);
 
-        sf_con.wfEs .= _mean_absfsfo .* sf_con.M⁺_sun .+
-                       _mean_fsfo    .* sf_con.M⁻_sun;
+        sf_con.wfEs .= _mean_absfsfo .* sf_con.M⁺_sun .+ _mean_fsfo .* sf_con.M⁻_sun;
 
         sf_con.ϕ_cosΘ .= view(ϕ_sun, :, :, i) .* absfs;
         mul!(sf_con.ϕ_cosΘ_lidf, adjoint(sf_con.ϕ_cosΘ), lidf);
@@ -217,7 +216,7 @@ function SIF_fluxes!(
     # 7. SIF from scattered internally and soil contribution
     sf_con.tmp_2d_nWlF_nLayer .= view(vb, iWLF, :) .* view(sf_con.F⁻, :, 1:nLayer) .+ view(vf, iWLF, :) .* view(sf_con.F⁺, :, 1:nLayer);
     mul!(can_rad.SIF_obs_scattered, sf_con.tmp_2d_nWlF_nLayer, Qo);
-    can_rad.SIF_obs_scattered .= can_rad.SIF_obs_scattered .* _iLAI_pi;
+    can_rad.SIF_obs_scattered .*= _iLAI_pi;
     can_rad.SIF_obs_soil .= ( ρ_SW_SIF .* view(sf_con.F⁻, :, nLayer+1) ) .* Po[end] ./ FT(pi);
 
     can_rad.SIF_hemi .= view(sf_con.F⁺, :, 1);
@@ -228,6 +227,10 @@ function SIF_fluxes!(
     end
 
     if photon
+        can_rad.SIF_obs_sunlit ./= WLF .* _FAC(FT);
+        can_rad.SIF_obs_shaded ./= WLF .* _FAC(FT);
+        can_rad.SIF_obs_scattered ./= WLF .* _FAC(FT);
+        can_rad.SIF_obs_soil ./= WLF .* _FAC(FT);
         can_rad.SIF_obs ./= WLF .* _FAC(FT);
     end;
 
@@ -235,16 +238,8 @@ function SIF_fluxes!(
 end
 
 
-
-
 """
-    SIF_fluxes!(leaf::LeafBios{FT},
-                in_rad::IncomingRadiation{FT},
-                wls::WaveLengths{FT},
-                rt_con::RTCache{FT},
-                fqe::FT = FT(0.01);
-                photon::Bool = true
-    ) where {FT<:AbstractFloat}
+    SIF_fluxes!(leaf::LeafBios{FT}, in_rad::IncomingRadiation{FT}, wls::WaveLengths{FT}, rt_con::RTCache{FT}, fqe::FT = FT(0.01); photon::Bool = true) where {FT<:AbstractFloat}
 
 Leaf level SIF, given
 - `leaf` [`LeafBios`](@ref) type struct
@@ -258,17 +253,10 @@ Note that `in_rad` assumes direct light with zenith angle of 0, and a zenith
     angle correction needs to be made before passing it to this function. The
     up- and down-ward SIF are stored in `sf_con` as `M⁻_sun` and `M⁺_sun`.
 """
-function SIF_fluxes!(
-            leaf::LeafBios{FT},
-            in_rad::IncomingRadiation{FT},
-            wls::WaveLengths{FT},
-            rt_con::RTCache{FT},
-            fqe::FT = FT(0.01);
-            photon::Bool = true
-) where {FT<:AbstractFloat}
+function SIF_fluxes!(leaf::LeafBios{FT}, in_rad::IncomingRadiation{FT}, wls::WaveLengths{FT}, rt_con::RTCache{FT}, fqe::FT = FT(0.01); photon::Bool = true) where {FT<:AbstractFloat}
     # unpack the values
-    @unpack Mb, Mf = leaf;
-    @unpack dWL_iWLE, iWLE, WLE, WLF = wls;
+    (; Mb, Mf) = leaf;
+    (; dWL_iWLE, iWLE, WLE, WLF) = wls;
     sf_con = rt_con.sf_con;
     sf_con.tmp_dwl_iWlE  .= (view(in_rad.E_direct , iWLE, 1) .+ view(in_rad.E_diffuse, iWLE, 1)) .* dWL_iWLE;
     if photon
diff --git a/src/CanopyLayers/layers/soil.jl b/src/CanopyLayers/layers/soil.jl
index 0692e883..a10d19cd 100644
--- a/src/CanopyLayers/layers/soil.jl
+++ b/src/CanopyLayers/layers/soil.jl
@@ -10,15 +10,10 @@ Hierachy of AbstractAlbedoFitting
 - [`FourBandsFittingCurve`](@ref)
 - [`FourBandsFittingHybrid`](@ref)
 - [`FourBandsFittingPoint`](@ref)
-- [`TwoBandsFittingCurve`](@ref)
-- [`TwoBandsFittingHybrid`](@ref)
-- [`TwoBandsFittingPoint`](@ref)
 """
 abstract type AbstractAlbedoFitting end
 
 
-
-
 """
 $(TYPEDEF)
 
@@ -27,8 +22,6 @@ Method to use all four GSV PCA bands to fit two flat lines
 struct FourBandsFittingCurve <: AbstractAlbedoFitting end
 
 
-
-
 """
 $(TYPEDEF)
 
@@ -37,8 +30,6 @@ Method to use all four GSV PCA bands to fit a mean and a flat curve
 struct FourBandsFittingHybrid <: AbstractAlbedoFitting end
 
 
-
-
 """
 $(TYPEDEF)
 
@@ -47,42 +38,6 @@ Method to use all four GSV PCA bands to fit 2 mean values
 struct FourBandsFittingPoint <: AbstractAlbedoFitting end
 
 
-
-
-"""
-$(TYPEDEF)
-
-Method to use 2 GSV PCA bands to fit two flat lines
-"""
-struct TwoBandsFittingCurve <: AbstractAlbedoFitting end
-
-
-
-
-"""
-$(TYPEDEF)
-
-Method to use 2 GSV PCA bands to fit a mean and a flat curve
-"""
-struct TwoBandsFittingHybrid <: AbstractAlbedoFitting end
-
-
-
-
-"""
-$(TYPEDEF)
-
-Method to use 2 GSV PCA bands to fit 2 mean values
-"""
-struct TwoBandsFittingPoint <: AbstractAlbedoFitting end
-
-
-
-
-
-
-
-
 ###############################################################################
 #
 # Calculate soil albedo based on color class and soil moisture
@@ -100,7 +55,7 @@ function soil_albedos(color::Int, swc::FT) where {FT<:AbstractFloat}
     @assert 1 <= color <=20;
 
     # calculate albedos for PAR and NIR
-    _delta   = max(0, FT(0.11) - FT(0.4) * swc);
+    _delta = max(0, FT(0.11) - FT(0.4) * swc);
     _alb_par::FT = max(SOIL_BNDS[color,1], SOIL_BNDS[color,3] + _delta);
     _alb_nir::FT = max(SOIL_BNDS[color,2], SOIL_BNDS[color,4] + _delta);
 
@@ -108,13 +63,7 @@ function soil_albedos(color::Int, swc::FT) where {FT<:AbstractFloat}
 end
 
 
-
-
-function soil_albedos(
-            color::Int,
-            rswc::FT,
-            rel::Bool
-) where {FT<:AbstractFloat}
+function soil_albedos(color::Int, rswc::FT, rel::Bool) where {FT<:AbstractFloat}
     # soil class must be from 1 to 20
     @assert 1 <= color <=20;
 
@@ -129,13 +78,7 @@ end
 
 
 """
-    fit_soil_mat!(
-                soil::SoilOpticals{FT},
-                wls::WaveLengths{FT},
-                swc::FT,
-                method::AbstractAlbedoFitting;
-                clm::Bool = false
-    ) where {FT<:AbstractFloat}
+    fit_soil_mat!(soil::SoilOpticals{FT}, wls::WaveLengths{FT}, swc::FT, method::AbstractAlbedoFitting; clm::Bool = false) where {FT<:AbstractFloat}
 
 Fit soil albedo bands parameters, given
 - `soil` [`SoilOpticals`](@ref) type structure
@@ -144,14 +87,8 @@ Fit soil albedo bands parameters, given
 - `method` [`AbstractAlbedoFitting`](@ref) type fitting method
 - `clm` If true, use CLM method, else use new method
 """
-function fit_soil_mat!(
-            soil::SoilOpticals{FT},
-            wls::WaveLengths{FT},
-            swc::FT,
-            method::AbstractAlbedoFitting;
-            clm::Bool = false
-) where {FT<:AbstractFloat}
-    @unpack iWLF = wls;
+function fit_soil_mat!(soil::SoilOpticals{FT}, wls::WaveLengths{FT}, swc::FT, method::AbstractAlbedoFitting; clm::Bool = false) where {FT<:AbstractFloat}
+    (; iWLF) = wls;
 
     # fit the curve only if the values mismatch
     if clm
@@ -171,16 +108,8 @@ function fit_soil_mat!(
 end
 
 
-
-
 """
-    fit_soil_mat!(
-                soil::SoilOpticals{FT},
-                wls::WaveLengths{FT},
-                ref_PAR::FT,
-                ref_NIR::FT,
-                method::FourBandsFittingCurve
-    ) where {FT<:AbstractFloat}
+    fit_soil_mat!(soil::SoilOpticals{FT}, wls::WaveLengths{FT}, ref_PAR::FT, ref_NIR::FT, method::FourBandsFittingCurve) where {FT<:AbstractFloat}
 
 Fit soil albedo bands parameters, given
 - `soil` [`SoilOpticals`](@ref) type structure
@@ -189,21 +118,20 @@ Fit soil albedo bands parameters, given
 - `ref_NIR` Target albedo for NIR
 - `method` [`FourBandsFittingCurve`](@ref) type fitting method
 """
-function fit_soil_mat!(
-            soil::SoilOpticals{FT},
-            wls::WaveLengths{FT},
-            ref_PAR::FT,
-            ref_NIR::FT,
-            method::FourBandsFittingCurve
-) where {FT<:AbstractFloat}
+function fit_soil_mat!(soil::SoilOpticals{FT}, wls::WaveLengths{FT}, ref_PAR::FT, ref_NIR::FT, method::FourBandsFittingCurve) where {FT<:AbstractFloat}
     # update soil PAR and NIR albedo
     soil.ρ_PAR = ref_PAR;
     soil.ρ_NIR = ref_NIR;
 
     # solve for weights using pinv
-    soil.ρ_SW_raw[32:end] .= ref_NIR;
-    soil.ρ_SW_raw[1:31] .= ref_PAR;
-    soil.SW_vec_4 .= pinv(soil.SW_mat_raw_4) * soil.ρ_SW_raw;
+    soil.ρ_SW[wls.iPAR] .= ref_PAR;
+    soil.ρ_SW[wls.iNIR] .= ref_NIR;
+
+    if !soil.hyperspectral
+        return nothing
+    end;
+
+    soil.SW_vec_4 .= pinv(soil.SW_mat_4) * soil.ρ_SW;
 
     # update vectors in soil
     mul!(soil.ρ_SW, soil.SW_mat_4, soil.SW_vec_4);
@@ -212,16 +140,8 @@ function fit_soil_mat!(
 end
 
 
-
-
 """
-    fit_soil_mat!(
-                soil::SoilOpticals{FT},
-                wls::WaveLengths{FT},
-                ref_PAR::FT,
-                ref_NIR::FT,
-                method::FourBandsFittingHybrid
-    ) where {FT<:AbstractFloat}
+    fit_soil_mat!(soil::SoilOpticals{FT}, wls::WaveLengths{FT}, ref_PAR::FT, ref_NIR::FT, method::FourBandsFittingHybrid) where {FT<:AbstractFloat}
 
 Fit soil albedo bands parameters, given
 - `soil` [`SoilOpticals`](@ref) type structure
@@ -230,91 +150,29 @@ Fit soil albedo bands parameters, given
 - `ref_NIR` Target albedo for NIR
 - `method` [`FourBandsFittingHybrid`](@ref) type fitting method
 """
-function fit_soil_mat!(
-            soil::SoilOpticals{FT},
-            wls::WaveLengths{FT},
-            ref_PAR::FT,
-            ref_NIR::FT,
-            method::FourBandsFittingHybrid
-) where {FT<:AbstractFloat}
+function fit_soil_mat!(soil::SoilOpticals{FT}, wls::WaveLengths{FT}, ref_PAR::FT, ref_NIR::FT, method::FourBandsFittingHybrid) where {FT<:AbstractFloat}
     # update soil PAR and NIR albedo
     soil.ρ_PAR = ref_PAR;
     soil.ρ_NIR = ref_NIR;
 
     # solve for weights using pinv
-    soil.ρ_SW_raw[32:end] .= ref_NIR;
-    soil.ρ_SW_raw[1:31] .= ref_PAR;
-    soil.SW_vec_4 .= pinv(soil.SW_mat_raw_4) * soil.ρ_SW_raw;
-
-    # solve for weights
-    @inline _fit(x::Vector{FT}) where {FT<:AbstractFloat} = (
-        mul!(soil.ρ_SW_raw, soil.SW_mat_raw_4, x);
-        _diff = ( mean(soil.ρ_SW_raw[1:31]) - ref_PAR ) ^ 2 +
-                mean( abs.(soil.ρ_SW_raw[32:end] .- ref_NIR) ) ^ 2;
-        return -_diff
-    );
-
-    _ms = ReduceStepMethodND{FT}(x_mins = FT[-2,-2,-2,-2],
-                                 x_maxs = FT[2,2,2,2],
-                                 x_inis = soil.SW_vec_4,
-                                 Δ_inis = FT[0.1,0.1,0.1,0.1]);
-    _tol = SolutionToleranceND{FT}(FT[0.001,0.001,0.001,0.001], 50);
-    _sol = find_peak(_fit, _ms, _tol);
-    soil.SW_vec_4 .= _sol;
-
-    # update vectors in soil
-    mul!(soil.ρ_SW, soil.SW_mat_4, soil.SW_vec_4);
-
-    return nothing
-end
-
-
-
+    soil.ρ_SW[wls.iPAR] .= ref_PAR;
+    soil.ρ_SW[wls.iNIR] .= ref_NIR;
 
-"""
-    fit_soil_mat!(
-                soil::SoilOpticals{FT},
-                wls::WaveLengths{FT},
-                ref_PAR::FT,
-                ref_NIR::FT,
-                method::FourBandsFittingPoint
-    ) where {FT<:AbstractFloat}
-
-Fit soil albedo bands parameters, given
-- `soil` [`SoilOpticals`](@ref) type structure
-- `wls` [`WaveLengths`](@ref) type structure
-- `ref_PAR` Target albedo for PAR
-- `ref_NIR` Target albedo for NIR
-- `method` [`FourBandsFittingPoint`](@ref) type fitting method
-"""
-function fit_soil_mat!(
-            soil::SoilOpticals{FT},
-            wls::WaveLengths{FT},
-            ref_PAR::FT,
-            ref_NIR::FT,
-            method::FourBandsFittingPoint
-) where {FT<:AbstractFloat}
-    # update soil PAR and NIR albedo
-    soil.ρ_PAR = ref_PAR;
-    soil.ρ_NIR = ref_NIR;
+    if !soil.hyperspectral
+        return nothing
+    end;
 
-    # solve for weights using pinv
-    soil.ρ_SW_raw[32:end] .= ref_NIR;
-    soil.ρ_SW_raw[1:31] .= ref_PAR;
-    soil.SW_vec_4 .= pinv(soil.SW_mat_raw_4) * soil.ρ_SW_raw;
+    soil.SW_vec_4 .= pinv(soil.SW_mat_4) * soil.ρ_SW;
 
     # solve for weights
     @inline _fit(x::Vector{FT}) where {FT<:AbstractFloat} = (
-        mul!(soil.ρ_SW_raw, soil.SW_mat_raw_4, x);
-        _diff = ( mean(soil.ρ_SW_raw[1:31]) - ref_PAR ) ^ 2 +
-                ( mean(soil.ρ_SW_raw[32:end]) - ref_NIR ) ^ 2;
+        mul!(soil.ρ_SW, soil.SW_mat_4, x);
+        _diff = ( mean(soil.ρ_SW[wls.iPAR]) - ref_PAR ) ^ 2 + mean( abs.(soil.ρ_SW[wls.iNIR] .- ref_NIR) ) ^ 2;
         return -_diff
     );
 
-    _ms = ReduceStepMethodND{FT}(x_mins = FT[-2,-2,-2,-2],
-                                 x_maxs = FT[2,2,2,2],
-                                 x_inis = soil.SW_vec_4,
-                                 Δ_inis = FT[0.1,0.1,0.1,0.1]);
+    _ms = ReduceStepMethodND{FT}(x_mins = FT[-2,-2,-2,-2], x_maxs = FT[2,2,2,2], x_inis = soil.SW_vec_4, Δ_inis = FT[0.1,0.1,0.1,0.1]);
     _tol = SolutionToleranceND{FT}(FT[0.001,0.001,0.001,0.001], 50);
     _sol = find_peak(_fit, _ms, _tol);
     soil.SW_vec_4 .= _sol;
@@ -329,140 +187,44 @@ end
 
 
 """
-    fit_soil_mat!(
-                soil::SoilOpticals{FT},
-                wls::WaveLengths{FT},
-                ref_PAR::FT,
-                ref_NIR::FT,
-                method::TwoBandsFittingCurve
-    ) where {FT<:AbstractFloat}
+    fit_soil_mat!(soil::SoilOpticals{FT}, wls::WaveLengths{FT}, ref_PAR::FT, ref_NIR::FT, method::FourBandsFittingPoint) where {FT<:AbstractFloat}
 
 Fit soil albedo bands parameters, given
 - `soil` [`SoilOpticals`](@ref) type structure
 - `wls` [`WaveLengths`](@ref) type structure
 - `ref_PAR` Target albedo for PAR
 - `ref_NIR` Target albedo for NIR
-- `method` [`TwoBandsFittingCurve`](@ref) type fitting method
+- `method` [`FourBandsFittingPoint`](@ref) type fitting method
 """
-function fit_soil_mat!(
-            soil::SoilOpticals{FT},
-            wls::WaveLengths{FT},
-            ref_PAR::FT,
-            ref_NIR::FT,
-            method::TwoBandsFittingCurve
-) where {FT<:AbstractFloat}
+function fit_soil_mat!(soil::SoilOpticals{FT}, wls::WaveLengths{FT}, ref_PAR::FT, ref_NIR::FT, method::FourBandsFittingPoint) where {FT<:AbstractFloat}
     # update soil PAR and NIR albedo
     soil.ρ_PAR = ref_PAR;
     soil.ρ_NIR = ref_NIR;
 
     # solve for weights using pinv
-    soil.ρ_SW_raw[32:end] .= ref_NIR;
-    soil.ρ_SW_raw[1:31] .= ref_PAR;
-    soil.SW_vec_2 .= pinv(soil.SW_mat_raw_2) * soil.ρ_SW_raw;
+    soil.ρ_SW[wls.iPAR] .= ref_PAR;
+    soil.ρ_SW[wls.iNIR] .= ref_NIR;
 
-    # update vectors in soil
-    mul!(soil.ρ_SW, soil.SW_mat_2, soil.SW_vec_2);
-
-    return nothing
-end
-
-
-
-
-"""
-    fit_soil_mat!(
-                soil::SoilOpticals{FT},
-                wls::WaveLengths{FT},
-                ref_PAR::FT,
-                ref_NIR::FT,
-                method::TwoBandsFittingHybrid
-    ) where {FT<:AbstractFloat}
-
-Fit soil albedo bands parameters, given
-- `soil` [`SoilOpticals`](@ref) type structure
-- `wls` [`WaveLengths`](@ref) type structure
-- `ref_PAR` Target albedo for PAR
-- `ref_NIR` Target albedo for NIR
-- `method` [`TwoBandsFittingHybrid`](@ref) type fitting method
-"""
-function fit_soil_mat!(
-            soil::SoilOpticals{FT},
-            wls::WaveLengths{FT},
-            ref_PAR::FT,
-            ref_NIR::FT,
-            method::TwoBandsFittingHybrid
-) where {FT<:AbstractFloat}
-    # update soil PAR and NIR albedo
-    soil.ρ_PAR = ref_PAR;
-    soil.ρ_NIR = ref_NIR;
+    if !soil.hyperspectral
+        return nothing
+    end;
 
-    # solve for weights using pinv
-    soil.ρ_SW_raw[32:end] .= ref_NIR;
-    soil.ρ_SW_raw[1:31] .= ref_PAR;
-    soil.SW_vec_2 .= pinv(soil.SW_mat_raw_2) * soil.ρ_SW_raw;
+    soil.SW_vec_4 .= pinv(soil.SW_mat_4) * soil.ρ_SW;
 
     # solve for weights
     @inline _fit(x::Vector{FT}) where {FT<:AbstractFloat} = (
-        mul!(soil.ρ_SW_raw, soil.SW_mat_raw_2, x);
-        _diff = ( mean(soil.ρ_SW_raw[1:31]) - ref_PAR ) ^ 2 +
-                mean( abs.(soil.ρ_SW_raw[32:end] .- ref_NIR) ) ^ 2;
+        mul!(soil.ρ_SW, soil.SW_mat_4, x);
+        _diff = ( mean(soil.ρ_SW[wls.iPAR]) - ref_PAR ) ^ 2 + ( mean(soil.ρ_SW[wls.iNIR]) - ref_NIR ) ^ 2;
         return -_diff
     );
 
-    _ms = ReduceStepMethodND{FT}(x_mins = FT[-2,-2],
-                                 x_maxs = FT[2,2],
-                                 x_inis = soil.SW_vec_2,
-                                 Δ_inis = FT[0.1,0.1]);
-    _tol = SolutionToleranceND{FT}(FT[0.001,0.001], 50);
+    _ms = ReduceStepMethodND{FT}(x_mins = FT[-2,-2,-2,-2], x_maxs = FT[2,2,2,2], x_inis = soil.SW_vec_4, Δ_inis = FT[0.1,0.1,0.1,0.1]);
+    _tol = SolutionToleranceND{FT}(FT[0.001,0.001,0.001,0.001], 50);
     _sol = find_peak(_fit, _ms, _tol);
-    soil.SW_vec_2 .= _sol;
-
-    # update vectors in soil
-    mul!(soil.ρ_SW, soil.SW_mat_2, soil.SW_vec_2);
-
-    return nothing
-end
-
-
-
-
-"""
-    fit_soil_mat!(
-                soil::SoilOpticals{FT},
-                wls::WaveLengths{FT},
-                ref_PAR::FT,
-                ref_NIR::FT,
-                method::TwoBandsFittingPoint
-    ) where {FT<:AbstractFloat}
-
-Fit soil albedo bands parameters, given
-- `soil` [`SoilOpticals`](@ref) type structure
-- `wls` [`WaveLengths`](@ref) type structure
-- `ref_PAR` Target albedo for PAR
-- `ref_NIR` Target albedo for NIR
-- `method` [`TwoBandsFittingPoint`](@ref) type fitting method
-"""
-function fit_soil_mat!(
-            soil::SoilOpticals{FT},
-            wls::WaveLengths{FT},
-            ref_PAR::FT,
-            ref_NIR::FT,
-            method::TwoBandsFittingPoint
-) where {FT<:AbstractFloat}
-    @unpack dry_NIR, dry_PAR, wet_NIR, wet_PAR = soil;
-
-    # update soil PAR and NIR albedo
-    soil.ρ_PAR = ref_PAR;
-    soil.ρ_NIR = ref_NIR;
-
-    # solve for weights
-    soil.SW_vec_2[1] = (ref_PAR * wet_NIR - ref_NIR * wet_PAR) /
-                       (wet_NIR * dry_PAR - wet_PAR * dry_NIR);
-    soil.SW_vec_2[2] = (ref_PAR * dry_NIR - ref_NIR * dry_PAR) /
-                       (dry_NIR * wet_PAR - dry_PAR * wet_NIR);
+    soil.SW_vec_4 .= _sol;
 
     # update vectors in soil
-    mul!(soil.ρ_SW, soil.SW_mat_2, soil.SW_vec_2);
+    mul!(soil.ρ_SW, soil.SW_mat_4, soil.SW_vec_4);
 
     return nothing
 end
diff --git a/src/CanopyLayers/layers/thermalfluxes.jl b/src/CanopyLayers/layers/thermalfluxes.jl
index 0891d7ab..8a1865fa 100644
--- a/src/CanopyLayers/layers/thermalfluxes.jl
+++ b/src/CanopyLayers/layers/thermalfluxes.jl
@@ -5,7 +5,7 @@
 ###############################################################################
 """
     thermal_fluxes!(
-                leaves::Array{LeafBios{FT},1},
+                leaves::Vector{LeafBios{FT}},
                 can_opt::CanopyOpticals{FT},
                 can_rad::CanopyRads{FT},
                 can::Canopy4RT{FT},
@@ -29,7 +29,7 @@ Computes 2-stream diffusive radiation transport for thermal radiation (calls
 - `wls` [`WaveLengths`](@ref) type struct
 """
 function thermal_fluxes!(
-            leaves::Array{LeafBios{FT},1},
+            leaves::Vector{LeafBios{FT}},
             can_opt::CanopyOpticals{FT},
             can_rad::CanopyRads{FT},
             can::Canopy4RT{FT},
@@ -37,11 +37,11 @@ function thermal_fluxes!(
             incLW::Array{FT},
             wls::WaveLengths{FT}
 ) where {FT<:AbstractFloat}
-    @unpack Ps, Po, Pso,ddf,ddb = can_opt
-    @unpack T_sun, T_shade = can_rad
-    @unpack LAI, nLayer, lidf, Ω = can
-    @unpack ρ_LW, T = soil
-    @unpack nWL = wls
+    (; Ps, Po, Pso, ddf, ddb) = can_opt
+    (; T_sun, T_shade) = can_rad
+    (; LAI, nLayer, lidf, Ω) = can
+    (; ρ_LW, T) = soil
+    (; nWL) = wls
 
     # 1. define some useful parameters
     iLAI = LAI * Ω / nLayer;
@@ -89,7 +89,6 @@ function thermal_fluxes!(
             ϵ[i]    = (1 - τ_dd[i] - ρ_dd[i]);
         end
     else
-        @warn "Array of leaves is neither 1 nor nLayer, use fist leaf here!";
         le = leaves[1]
         for i=1:nLayer
             sigf    = ddf*le.ρ_LW + ddb*le.τ_LW
diff --git a/src/CanopyLayers/types/caches.jl b/src/CanopyLayers/types/caches.jl
index bf29ce78..a0fd0932 100644
--- a/src/CanopyLayers/types/caches.jl
+++ b/src/CanopyLayers/types/caches.jl
@@ -13,32 +13,43 @@ $(TYPEDFIELDS)
 """
 Base.@kwdef mutable struct CFCache{FT}
     "absorbed energy from wave lengths"
-    abs_wave   ::Array{FT,1}
+    abs_wave::Vector{FT}
     "absfs' * lidf [nAzi]"
-    absfs_lidf ::Array{FT,1}
+    absfs_lidf::Vector{FT}
     "wave length energy [same as dWL]"
-    E_all      ::Array{FT,1}
+    E_all::Vector{FT}
     "wave length energy [same as iPAR]"
-    E_iPAR     ::Array{FT,1}
+    E_iPAR::Vector{FT}
     "lPs [nLayer]"
-    lPs        ::Array{FT,1}
+    lPs::Vector{FT}
     "kChlrel [same as iPAR]"
-    kChlrel    ::Array{FT,1}
+    kChlrel::Vector{FT}
     "diffusive PAR [same as iPAR]"
-    PAR_diff   ::Array{FT,1}
+    PAR_diff::Vector{FT}
     "diffusive PAR for photosynthesis [same as iPAR]"
-    PAR_diffCab::Array{FT,1}
+    PAR_diffCab::Vector{FT}
     "direct PAR [same as iPAR]"
-    PAR_dir    ::Array{FT,1}
+    PAR_dir::Vector{FT}
     "diffusive PAR for photosynthesis [same as iPAR]"
-    PAR_dirCab ::Array{FT,1}
+    PAR_dirCab::Vector{FT}
 end
 
+CFCache{FT}(rt_dim::RTDimensions) where {FT} = (
+    (; nAzi, nLayer, nPAR, nWL) = rt_dim;
 
-
-
-
-
+    return CFCache{FT}(
+                abs_wave    = zeros(FT, nWL),
+                absfs_lidf  = zeros(FT, nAzi),
+                E_all       = zeros(FT, nWL),
+                E_iPAR      = zeros(FT, nPAR),
+                lPs         = zeros(FT, nLayer),
+                kChlrel     = zeros(FT, nPAR),
+                PAR_diff    = zeros(FT, nPAR),
+                PAR_diffCab = zeros(FT, nPAR),
+                PAR_dir     = zeros(FT, nPAR),
+                PAR_dirCab  = zeros(FT, nPAR)
+    )
+);
 
 
 ###############################################################################
@@ -57,30 +68,39 @@ $(TYPEDFIELDS)
 Base.@kwdef mutable struct CGCache{FT}
     # 1D arrays
     "cos_ttli .* cos(vza) dim: nIncl"
-    _Co ::Array{FT,1}
+    _Co::Vector{FT}
     "cos_ttli .* cos(sza) dim: nIncl"
-    _Cs ::Array{FT,1}
+    _Cs::Vector{FT}
     "sin_ttli .* sin(vza) dim: nIncl"
-    _So ::Array{FT,1}
+    _So::Vector{FT}
     "sin_ttli .* sin(sza) dim: nIncl"
-    _Ss ::Array{FT,1}
+    _Ss::Vector{FT}
 
     # 2D arrays
     "maxtrix filled with 1 dim: (1, nAzi)"
-    _1s ::Array{FT,2}
+    _1s::Matrix{FT}
     "2D array to speed up _cds and _cdo dim: (nIncl, nAzi)"
-    _2d ::Array{FT,2}
+    _2d::Matrix{FT}
     "_Co * _1s .+ _So * cos_philo' dim: (nIncl, nAzi)"
-    _cdo::Array{FT,2}
+    _cdo::Matrix{FT}
     "_Cs * _1s .+ _Ss * cos_ttlo' dim: (nIncl, nAzi)"
-    _cds::Array{FT,2}
+    _cds::Matrix{FT}
 end
 
+CGCache{FT}(rt_dim::RTDimensions) where {FT} = (
+    (; nAzi, nIncl) = rt_dim;
 
-
-
-
-
+    return CGCache{FT}(
+                _Co  = zeros(FT, nIncl),
+                _Cs  = zeros(FT, nIncl),
+                _So  = zeros(FT, nIncl),
+                _Ss  = zeros(FT, nIncl),
+                _1s  = ones(FT, (1, nAzi)),
+                _2d  = zeros(FT, (nIncl, nAzi)),
+                _cdo = zeros(FT, (nIncl, nAzi)),
+                _cds = zeros(FT, (nIncl, nAzi))
+    )
+);
 
 
 ###############################################################################
@@ -98,68 +118,120 @@ $(TYPEDFIELDS)
 """
 Base.@kwdef mutable struct SFCache{FT}
     # 1D array
-    M⁻_sun        ::Array{FT,1}
-    M⁺_sun        ::Array{FT,1}
-    wfEs          ::Array{FT,1}
-    sfEs          ::Array{FT,1}
-    sbEs          ::Array{FT,1}
-    M⁺⁻           ::Array{FT,1}
-    M⁺⁺           ::Array{FT,1}
-    M⁻⁺           ::Array{FT,1}
-    M⁻⁻           ::Array{FT,1}
-    sun_dwl_iWlE  ::Array{FT,1}
-    tmp_dwl_iWlE  ::Array{FT,1}
-    ϕ_cosΘ_lidf   ::Array{FT,1}
-    vfEplu_shade  ::Array{FT,1}
-    vbEmin_shade  ::Array{FT,1}
-    vfEplu_sun    ::Array{FT,1}
-    vbEmin_sun    ::Array{FT,1}
-    sigfEmin_shade::Array{FT,1}
-    sigbEmin_shade::Array{FT,1}
-    sigfEmin_sun  ::Array{FT,1}
-    sigbEmin_sun  ::Array{FT,1}
-    sigfEplu_shade::Array{FT,1}
-    sigbEplu_shade::Array{FT,1}
-    sigfEplu_sun  ::Array{FT,1}
-    sigbEplu_sun  ::Array{FT,1}
-    zeroB         ::Array{FT,1}
-    tmp_1d_nWlF   ::Array{FT,1}
-    tmp_1d_nLayer ::Array{FT,1}
-    dnorm         ::Array{FT,1}
+    M⁻_sun::Vector{FT}
+    M⁺_sun::Vector{FT}
+    wfEs::Vector{FT}
+    sfEs::Vector{FT}
+    sbEs::Vector{FT}
+    M⁺⁻::Vector{FT}
+    M⁺⁺::Vector{FT}
+    M⁻⁺::Vector{FT}
+    M⁻⁻::Vector{FT}
+    sun_dwl_iWlE::Vector{FT}
+    tmp_dwl_iWlE::Vector{FT}
+    ϕ_cosΘ_lidf::Vector{FT}
+    vfEplu_shade::Vector{FT}
+    vbEmin_shade::Vector{FT}
+    vfEplu_sun::Vector{FT}
+    vbEmin_sun::Vector{FT}
+    sigfEmin_shade::Vector{FT}
+    sigbEmin_shade::Vector{FT}
+    sigfEmin_sun::Vector{FT}
+    sigbEmin_sun::Vector{FT}
+    sigfEplu_shade::Vector{FT}
+    sigbEplu_shade::Vector{FT}
+    sigfEplu_sun::Vector{FT}
+    sigbEplu_sun::Vector{FT}
+    zeroB::Vector{FT}
+    tmp_1d_nWlF::Vector{FT}
+    tmp_1d_nLayer::Vector{FT}
+    dnorm::Vector{FT}
 
     # 2D array
     "transmission of diffusive light?"
-    τ_dd                ::Array{FT,2}
+    τ_dd::Matrix{FT}
     "extinction of diffuse light?"
-    ρ_dd                ::Array{FT,2}
-    Xdd                 ::Array{FT,2}
-    Rdd                 ::Array{FT,2}
-    Y                   ::Array{FT,2}
-    U                   ::Array{FT,2}
-    S⁻                  ::Array{FT,2}
-    S⁺                  ::Array{FT,2}
-    piLs                ::Array{FT,2}
-    piLd                ::Array{FT,2}
-    Fsmin               ::Array{FT,2}
-    Fsplu               ::Array{FT,2}
-    Fdmin               ::Array{FT,2}
-    Fdplu               ::Array{FT,2}
-    Femo                ::Array{FT,2}
-    M⁺                  ::Array{FT,2}
-    M⁻                  ::Array{FT,2}
-    ϕ_cosΘ              ::Array{FT,2}
-    F⁻                  ::Array{FT,2}
-    F⁺                  ::Array{FT,2}
-    net_diffuse         ::Array{FT,2}
-    tmp_2d_nWlF_nLayer  ::Array{FT,2}
-    tmp_2d_nWlF_nLayer_2::Array{FT,2}
+    ρ_dd::Matrix{FT}
+    Xdd::Matrix{FT}
+    Rdd::Matrix{FT}
+    Y::Matrix{FT}
+    U::Matrix{FT}
+    S⁻::Matrix{FT}
+    S⁺::Matrix{FT}
+    piLs::Matrix{FT}
+    piLd::Matrix{FT}
+    Fsmin::Matrix{FT}
+    Fsplu::Matrix{FT}
+    Fdmin::Matrix{FT}
+    Fdplu::Matrix{FT}
+    Femo::Matrix{FT}
+    M⁺::Matrix{FT}
+    M⁻::Matrix{FT}
+    ϕ_cosΘ::Matrix{FT}
+    F⁻::Matrix{FT}
+    F⁺::Matrix{FT}
+    net_diffuse::Matrix{FT}
+    tmp_2d_nWlF_nLayer::Matrix{FT}
+    tmp_2d_nWlF_nLayer_2::Matrix{FT}
 end
 
-
-
-
-
-
+SFCache{FT}(rt_dim::RTDimensions) where {FT} = (
+    (; nAzi, nIncl, nLayer, nLevel, nWLE, nWLF) = rt_dim;
+
+    return SFCache{FT}(
+                τ_dd                 = zeros(FT, (nWLF,nLayer)),
+                Xdd                  = zeros(FT, (nWLF,nLayer)),
+                Rdd                  = zeros(FT, (nWLF,nLevel)),
+                Y                    = zeros(FT, (nWLF,nLayer)),
+                U                    = zeros(FT, (nWLF,nLevel)),
+                dnorm                = zeros(FT, nWLF),
+                ρ_dd                 = zeros(FT, (nWLF,nLayer)),
+                S⁻                   = zeros(FT, (nWLF,nLayer)),
+                S⁺                   = zeros(FT, (nWLF,nLayer)),
+                piLs                 = zeros(FT, (nWLF,nLayer)),
+                piLd                 = zeros(FT, (nWLF,nLayer)),
+                Fsmin                = zeros(FT, (nWLF,nLayer)),
+                Fsplu                = zeros(FT, (nWLF,nLayer)),
+                Fdmin                = zeros(FT, (nWLF,nLayer)),
+                Fdplu                = zeros(FT, (nWLF,nLayer)),
+                Femo                 = zeros(FT, (nWLF,nLayer)),
+                M⁺                   = zeros(FT, (nWLF,nWLE)),
+                M⁻                   = zeros(FT, (nWLF,nWLE)),
+                M⁻_sun               = zeros(FT, nWLF),
+                M⁺_sun               = zeros(FT, nWLF),
+                wfEs                 = zeros(FT, nWLF),
+                sfEs                 = zeros(FT, nWLF),
+                sbEs                 = zeros(FT, nWLF),
+                M⁺⁻                  = zeros(FT, nWLF),
+                M⁺⁺                  = zeros(FT, nWLF),
+                M⁻⁺                  = zeros(FT, nWLF),
+                M⁻⁻                  = zeros(FT, nWLF),
+                sun_dwl_iWlE         = zeros(FT, nWLE),
+                tmp_dwl_iWlE         = zeros(FT, nWLE),
+                ϕ_cosΘ               = zeros(FT, (nIncl,nAzi)),
+                ϕ_cosΘ_lidf          = zeros(FT, nAzi),
+                vfEplu_shade         = zeros(FT, nWLF),
+                vbEmin_shade         = zeros(FT, nWLF),
+                vfEplu_sun           = zeros(FT, nWLF),
+                vbEmin_sun           = zeros(FT, nWLF),
+                sigfEmin_shade       = zeros(FT, nWLF),
+                sigbEmin_shade       = zeros(FT, nWLF),
+                sigfEmin_sun         = zeros(FT, nWLF),
+                sigbEmin_sun         = zeros(FT, nWLF),
+                sigfEplu_shade       = zeros(FT, nWLF),
+                sigbEplu_shade       = zeros(FT, nWLF),
+                sigfEplu_sun         = zeros(FT, nWLF),
+                sigbEplu_sun         = zeros(FT, nWLF),
+                zeroB                = zeros(FT, nWLF),
+                F⁻                   = zeros(FT, (nWLF,nLevel)),
+                F⁺                   = zeros(FT, (nWLF,nLevel)),
+                net_diffuse          = zeros(FT, (nWLF,nLayer)),
+                tmp_1d_nWlF          = zeros(FT, nWLF),
+                tmp_1d_nLayer        = zeros(FT, nLayer),
+                tmp_2d_nWlF_nLayer   = zeros(FT, (nWLF,nLayer)),
+                tmp_2d_nWlF_nLayer_2 = zeros(FT, (nWLF,nLayer))
+    )
+);
 
 
 ###############################################################################
@@ -178,32 +250,42 @@ $(TYPEDFIELDS)
 Base.@kwdef mutable struct SWCache{FT}
     # 1D arrays
     "dnorm?"
-    dnorm ::Array{FT,1}
+    dnorm::Vector{FT}
     "pi * Lo"
-    piLo  ::Array{FT,1}
+    piLo::Vector{FT}
     "pi * Lo from canopy"
-    piLoc ::Array{FT,1}
+    piLoc::Vector{FT}
     "pi * Lo from soil"
-    piLos ::Array{FT,1}
+    piLos::Vector{FT}
 
     # 2D arrays
     "pi * Lo from canopy 2D matrix"
-    piLoc2::Array{FT,2}
+    piLoc2::Matrix{FT}
     "extinction of diffuse light?"
-    ρ_dd  ::Array{FT,2}
+    ρ_dd::Matrix{FT}
     "extinction of direct light?"
-    ρ_sd  ::Array{FT,2}
+    ρ_sd::Matrix{FT}
     "transmission of diffusive light?"
-    τ_dd  ::Array{FT,2}
+    τ_dd::Matrix{FT}
     "transmission of direct light?"
-    τ_sd  ::Array{FT,2}
+    τ_sd::Matrix{FT}
 end
 
+SWCache{FT}(rt_dim::RTDimensions) where {FT} = (
+    (; nLayer, nWL) = rt_dim;
 
-
-
-
-
+    return SWCache{FT}(
+                dnorm  = zeros(FT, nWL),
+                piLo   = zeros(FT, nWL),
+                piLoc  = zeros(FT, nWL),
+                piLos  = zeros(FT, nWL),
+                piLoc2 = zeros(FT, (nWL,nLayer)),
+                ρ_dd   = zeros(FT, (nWL,nLayer)),
+                ρ_sd   = zeros(FT, (nWL,nLayer)),
+                τ_dd   = zeros(FT, (nWL,nLayer)),
+                τ_sd   = zeros(FT, (nWL,nLayer))
+    )
+);
 
 
 ###############################################################################
@@ -229,3 +311,12 @@ Base.@kwdef mutable struct RTCache{FT}
     "[`SWCache`](@ref) type cache"
     sw_con::SWCache{FT}
 end
+
+function RTCache{FT}(rt_dim::RTDimensions) where {FT}
+    return RTCache{FT}(
+                cf_con = CFCache{FT}(rt_dim),
+                cg_con = CGCache{FT}(rt_dim),
+                sf_con = SFCache{FT}(rt_dim),
+                sw_con = SWCache{FT}(rt_dim)
+    )
+end
diff --git a/src/CanopyLayers/types/canopy4rt.jl b/src/CanopyLayers/types/canopy4rt.jl
index f6a4e223..46d1e491 100644
--- a/src/CanopyLayers/types/canopy4rt.jl
+++ b/src/CanopyLayers/types/canopy4rt.jl
@@ -18,67 +18,61 @@ Base.@kwdef mutable struct Canopy4RT{FT<:AbstractFloat}
 
     # canopy information
     "Leaf Area Index"
-    LAI       ::FT = FT(3.0 )
+    LAI::FT = 3
     "Clumping factor"
-    Ω         ::FT = FT(1.0 )
+    Ω::FT = 1
     "Structure factor a"
-    clump_a   ::FT = FT(1.0 )
+    clump_a::FT = 1
     "Structure factor b"
-    clump_b   ::FT = FT(0.0 )
-    "Leaf width"
-    leaf_width::FT = FT(0.1 )
-    "Vegetation height"
-    hc        ::FT = FT(2.0 )
+    clump_b::FT = 0
     "Leaf Inclination"
-    LIDFa     ::FT = FT(0.0 )
+    LIDFa::FT = FT(0)
     "Variation in leaf inclination"
-    LIDFb     ::FT = FT(0.0 )
+    LIDFb::FT = FT(0)
     "HotSpot parameter (still need to check!)"
-    hot       ::FT = FT(0.05)
+    hot::FT = 0.05
 
     # tree/canopy/leaf traits
-    "Canopy height `[m]`"
-    height::FT = FT(20.0  )
     "Canopy roughness `[m]`"
-    z0m   ::FT = FT(1.0   )
+    z0m::FT = 1
     "Tree roughtnes `[m]`"
-    z0h   ::FT = FT(-999.0)
+    z0h::FT = -999
     "Canopy displacement height `[m]`"
-    d     ::FT = FT(-999.0)
+    d::FT = -999
     "m/sqrt(s) turbulent transfer coefficient"
-    Cd    ::FT = FT(0.01  )
+    Cd::FT = 0.01
 
     # Some more derived parameters:
     "List of mean inclination angles `[°]`"
-    litab    ::Array{FT,1} = collect(FT,5:10:85)
+    litab::Vector{FT} = collect(FT,5:10:85)
     "List of inclination angle boundaries `[°]`"
-    litab_bnd::Array{FT,2} = [collect(0:10:80) collect(FT,10:10:90)]
+    litab_bnd::Matrix{FT} = [collect(0:10:80) collect(FT,10:10:90)]
     "List of mean azimuth angles `[°]`"
-    lazitab  ::Array{FT,1} = collect(FT,5:10:355)
+    lazitab::Vector{FT} = collect(FT,5:10:355)
 
     # variables used for canopy_geometry!
     "Cosine of lazitab"
-    cos_ttlo ::Array{FT,1} = cosd.(lazitab)
+    cos_ttlo::Vector{FT} = cosd.(lazitab)
     "Cosine of lazitab - raa (relative azimuth angle), update with time"
-    cos_philo::Array{FT,1} = cosd.(lazitab .- 0)
+    cos_philo::Vector{FT} = cosd.(lazitab .- 0)
     "Cosine of litab"
-    cos_ttli ::Array{FT,1} = cosd.(litab)
+    cos_ttli::Vector{FT} = cosd.(litab)
     "Sine of litab"
-    sin_ttli ::Array{FT,1} = sind.(litab)
+    sin_ttli::Vector{FT} = sind.(litab)
     "Cache for volome scatter function"
-    vol_scatt::Array{FT,1} = ones(FT, 4)
+    vol_scatt::Vector{FT} = ones(FT, 4)
 
     # This is changed afterwards, ignore here.
     "Inclination angles weight distribution"
-    lidf::Array{FT,1} = dladgen(LIDFa, LIDFb, litab_bnd)
+    lidf::Vector{FT} = dladgen(LIDFa, LIDFb, litab_bnd)
     "List of level location (level = layer + 1)"
-    xl  ::Array{FT,1} = collect(FT, 0:-1.0/nLayer:-1)
+    xl::Vector{FT} = collect(FT, 0:-1.0/nLayer:-1)
     "1/nLayer"
-    dx  ::FT = FT(1)/nLayer
+    dx::FT = 1 / nLayer
 
     # local storage of dimension information
     "Number of azimuth angles"
-    nAzi ::Int = length(lazitab)
+    nAzi::Int = length(lazitab)
     "Number of inclination angles"
     nIncl::Int = length(litab)
 end
diff --git a/src/CanopyLayers/types/canopyopticals.jl b/src/CanopyLayers/types/canopyopticals.jl
index bcbb4e51..1cdca003 100644
--- a/src/CanopyLayers/types/canopyopticals.jl
+++ b/src/CanopyLayers/types/canopyopticals.jl
@@ -14,94 +14,100 @@ $(TYPEDFIELDS)
 Base.@kwdef mutable struct CanopyOpticals{FT}
     # local storage of dimension information
     "Number of azimuth angles"
-    nAzi  ::Int = 36
+    nAzi::Int = 36
     "Number of inclination agles"
-    nIncl ::Int = 9
+    nIncl::Int = 9
     "Number of canopy layers"
     nLayer::Int = 5
     "Number of wave lengths"
-    nWL   ::Int = 10
+    nWL::Int = 10
 
     # Single value
     "Solar -> Diffuse backscatter weight"
-    sdb::FT = FT(0.0)
+    sdb::FT = 0
     "Solar -> Diffuse forward scatter weight"
-    sdf::FT = FT(0.0)
+    sdf::FT = 0
     "Diffuse -> Directional backscatter weight"
-    dob::FT = FT(0.0)
+    dob::FT = 0
     "Diffuse -> Directional forward scatter weight"
-    dof::FT = FT(0.0)
+    dof::FT = 0
     "Diffuse -> Diffuse backscatter weight"
-    ddb::FT = FT(0.0)
+    ddb::FT = 0
     "Diffuse -> Diffuse forward scatter weight"
-    ddf::FT = FT(0.0)
+    ddf::FT = 0
     "Solar beam extinction coefficient weight"
-    ks ::FT = FT(0.0)
+    ks::FT = 0
     "Outgoing beam extinction coefficient weight"
-    ko ::FT = FT(0.0)
+    ko::FT = 0
     # TODO What is this?
     "?"
-    bf ::FT = FT(0.0)
+    bf::FT = 0
     "Weight of specular2directional backscatter coefficient"
-    sob::FT = FT(0.0)
+    sob::FT = 0
     "Weight of specular2directional forward coefficient"
-    sof::FT = FT(0.0)
+    sof::FT = 0
 
     # dimension of nLevel
     "Probability of directly viewing a leaf in solar direction"
-    Ps ::Array{FT,1} = zeros(FT, nLayer+1)
+    Ps::Vector{FT} = zeros(FT, nLayer+1)
     "Probability of directly viewing a leaf in viewing direction"
-    Po ::Array{FT,1} = zeros(FT, nLayer+1)
+    Po::Vector{FT} = zeros(FT, nLayer+1)
     "Bi-directional probability of directly viewing a leaf (solar->canopy->viewing)"
-    Pso::Array{FT,1} = zeros(FT, nLayer+1)
+    Pso::Vector{FT} = zeros(FT, nLayer+1)
 
     # dimension of nIncl * nAzi
     "conversion factor fs to compute irradiance on inclined leaf"
-    fs     ::Array{FT,2} = zeros(FT, (nIncl, nAzi))
+    fs::Matrix{FT} = zeros(FT, (nIncl, nAzi))
     "abs(fs)"
-    absfs  ::Array{FT,2} = zeros(FT, (nIncl, nAzi))
+    absfs::Matrix{FT} = zeros(FT, (nIncl, nAzi))
     "abs(fs*fo)"
-    absfsfo::Array{FT,2} = zeros(FT, (nIncl, nAzi))
+    absfsfo::Matrix{FT} = zeros(FT, (nIncl, nAzi))
     "fs*fo"
-    fsfo   ::Array{FT,2} = zeros(FT, (nIncl, nAzi))
+    fsfo::Matrix{FT} = zeros(FT, (nIncl, nAzi))
     "conversion factor fo for angle towards observer (not sun like fs)"
-    fo     ::Array{FT,2} = zeros(FT, (nIncl, nAzi))
+    fo::Matrix{FT} = zeros(FT, (nIncl, nAzi))
     "abs(fo)"
-    absfo  ::Array{FT,2} = zeros(FT, (nIncl, nAzi))
+    absfo::Matrix{FT} = zeros(FT, (nIncl, nAzi))
     "Cosine of leaf azimuths"
-    cosΘ_l ::Array{FT,2} = zeros(FT, (nIncl, nAzi))
+    cosΘ_l::Matrix{FT} = zeros(FT, (nIncl, nAzi))
     "cos of leaf azimuth sqared"
-    cos2Θ_l::Array{FT,2} = zeros(FT, (nIncl, nAzi))
+    cos2Θ_l::Matrix{FT} = zeros(FT, (nIncl, nAzi))
 
     # The following also depend on leaf reflectance and transmission.
     # Might go into a separate strcuture so that we can have it separately for thermal, SW and SIF?
     # dimension of nWL * nLayer
     "diffuse     backscatter scattering coefficient for diffuse  incidence"
-    sigb::Array{FT,2} = zeros(FT, (nWL,nLayer))
+    sigb::Matrix{FT} = zeros(FT, (nWL,nLayer))
     "diffuse     forward     scattering coefficient for diffuse  incidence"
-    sigf::Array{FT,2} = zeros(FT, (nWL,nLayer))
+    sigf::Matrix{FT} = zeros(FT, (nWL,nLayer))
     "diffuse     backscatter scattering coefficient for specular incidence"
-    sb  ::Array{FT,2} = zeros(FT, (nWL,nLayer))
+    sb::Matrix{FT} = zeros(FT, (nWL,nLayer))
     "diffuse     forward     scattering coefficient for specular incidence"
-    sf  ::Array{FT,2} = zeros(FT, (nWL,nLayer))
+    sf::Matrix{FT} = zeros(FT, (nWL,nLayer))
     "directional backscatter scattering coefficient for diffuse  incidence"
-    vb  ::Array{FT,2} = zeros(FT, (nWL,nLayer))
+    vb::Matrix{FT} = zeros(FT, (nWL,nLayer))
     "directional forward     scattering coefficient for diffuse  incidence"
-    vf  ::Array{FT,2} = zeros(FT, (nWL,nLayer))
+    vf::Matrix{FT} = zeros(FT, (nWL,nLayer))
     "bidirectional scattering coefficent (directional-directional)"
-    w   ::Array{FT,2} = zeros(FT, (nWL,nLayer))
+    w::Matrix{FT} = zeros(FT, (nWL,nLayer))
     "attenuation"
-    a   ::Array{FT,2} = zeros(FT, (nWL,nLayer))
+    a::Matrix{FT} = zeros(FT, (nWL,nLayer))
     "Effective layer transmittance (direct->diffuse)"
-    Xsd ::Array{FT,2} = zeros(FT, (nWL,nLayer))
+    Xsd::Matrix{FT} = zeros(FT, (nWL,nLayer))
     "Effective layer transmittance (diffuse->diffuse)"
-    Xdd ::Array{FT,2} = zeros(FT, (nWL,nLayer))
+    Xdd::Matrix{FT} = zeros(FT, (nWL,nLayer))
 
     # dimension of nWL * nLevel
     "Effective layer reflectance (direct->diffuse)"
-    R_sd::Array{FT,2} = zeros(FT, (nWL, nLayer+1))
+    R_sd::Matrix{FT} = zeros(FT, (nWL, nLayer+1))
     "Effective layer reflectance (diffuse->diffuse)"
-    R_dd::Array{FT,2} = zeros(FT, (nWL, nLayer+1))
+    R_dd::Matrix{FT} = zeros(FT, (nWL, nLayer+1))
     "Solar direct radiation per layer)"
-    Es_::Array{FT,2}  = zeros(FT, (nWL, nLayer+1))
+    Es_::Matrix{FT}  = zeros(FT, (nWL, nLayer+1))
 end
+
+CanopyOpticals{FT}(rt_dim::RTDimensions) where {FT} = (
+    (; nAzi, nIncl, nLayer, nWL) = rt_dim;
+
+    return CanopyOpticals{FT}(nAzi = nAzi, nIncl = nIncl, nLayer = nLayer, nWL = nWL)
+);
diff --git a/src/CanopyLayers/types/canopyrads.jl b/src/CanopyLayers/types/canopyrads.jl
index 5c457043..67b7b951 100644
--- a/src/CanopyLayers/types/canopyrads.jl
+++ b/src/CanopyLayers/types/canopyrads.jl
@@ -14,137 +14,143 @@ $(TYPEDFIELDS)
 Base.@kwdef mutable struct CanopyRads{FT}
     # local storage of dimension information
     "Number of azimuth angles"
-    nAzi  ::Int = 36
+    nAzi::Int = 36
     "Number of inclination agles"
-    nIncl ::Int = 9
+    nIncl::Int = 9
     "Number of canopy layers"
     nLayer::Int = 5
     "Number of canopy levels"
     nLevel::Int = nLayer+1
     "Number of wave lengths"
-    nWL   ::Int = 10
+    nWL::Int = 10
     "Number of wave lengths for SIF"
-    nWLF  ::Int = 10
+    nWLF::Int = 10
 
     # Scalars
     "Integrated TOC outgoing flux `[W m⁻²]`"
-    intEout            ::FT = 0
+    intEout::FT = 0
     "Incident spectrally integrated total PAR `[mol m⁻² s⁻¹]`"
-    incomingPAR        ::FT = 0
+    incomingPAR::FT = 0
     "Incident spectrally integrated direct PAR `[mol m⁻² s⁻¹]`"
-    incomingPAR_direct ::FT = 0
+    incomingPAR_direct::FT = 0
     "Incident spectrally integrated diffuse PAR `[mol m⁻² s⁻¹]`"
     incomingPAR_diffuse::FT = 0
     "Net radiation of shaded soil `[W m⁻²]`"
-    RnSoil_diffuse     ::FT = 0
+    RnSoil_diffuse::FT = 0
     "Net Short-wave radiation of sunlit soil `[W m⁻²]`"
-    RnSoil_direct      ::FT = 0
+    RnSoil_direct::FT = 0
     "Net Short-wave radiation of soil (shaded + sunlit) `[W m⁻²]`"
-    RnSoil             ::FT = 0
+    RnSoil::FT = 0
     "Net long-wave radiation of soil (shaded + sunlit) `[W m⁻²]`"
-    RnSoilLW           ::FT = 0
+    RnSoilLW::FT = 0
 
     # Dim of nLayer
     "Net PAR of shaded leaves `[mol m⁻² s⁻¹]`"
-    absPAR_shade   ::Array{FT,1} = zeros(FT, nLayer)
+    absPAR_shade::Vector{FT} = zeros(FT, nLayer)
     "Net PAR by Cab+Car of shaded leaves `[moles m⁻² s⁻¹]`"
-    absPAR_shadeCab::Array{FT,1} = zeros(FT, nLayer)
+    absPAR_shadeCab::Vector{FT} = zeros(FT, nLayer)
     "Spectrally integrated net absorbed direct radiation in each layer per leaf area `[W m⁻²]`"
-    intNetSW_sunlit::Array{FT,1} = zeros(FT, nLayer)
+    intNetSW_sunlit::Vector{FT} = zeros(FT, nLayer)
     "Spectrally integrated net absorbed diffuse radiation in each layer per leaf area `[W m⁻²]`"
-    intNetSW_shade ::Array{FT,1} = zeros(FT, nLayer)
+    intNetSW_shade::Vector{FT} = zeros(FT, nLayer)
     "Spectrally integrated net absorbed direct radiation in each layer per leaf area `[W m⁻²]`"
-    intNetLW_sunlit::Array{FT,1} = zeros(FT, nLayer)
+    intNetLW_sunlit::Vector{FT} = zeros(FT, nLayer)
     "Spectrally integrated net absorbed diffuse radiation in each layer per leaf area `[W m⁻²]`"
-    intNetLW_shade ::Array{FT,1} = zeros(FT, nLayer)
+    intNetLW_shade::Vector{FT} = zeros(FT, nLayer)
     "Leaf temperature (sunlit) `[K]`"
-    T_sun          ::Array{FT,1} = zeros(FT, nLayer) .+ FT(298.15)
+    T_sun::Vector{FT} = zeros(FT, nLayer) .+ 298.15
     "Leaf temperature (shaded) `[K]`"
-    T_shade        ::Array{FT,1} = zeros(FT, nLayer) .+ FT(298.15)
+    T_shade::Vector{FT} = zeros(FT, nLayer) .+ 298.15
     "Fluorescence yield for shaded leaves"
-    ϕ_shade        ::Array{FT,1} =  ones(FT, nLayer) .* FT(0.01)
+    ϕ_shade::Vector{FT} =  ones(FT, nLayer) .* 0.01
     "Sensible Heat flux H of shaded leaves `[W m⁻²]`"
-    H_shade        ::Array{FT,1} = zeros(FT, nLayer)
+    H_shade::Vector{FT} = zeros(FT, nLayer)
     "Latent Heat flux LE of shaded leaves `[W m⁻²]`"
-    LE_shade       ::Array{FT,1} = zeros(FT, nLayer)
+    LE_shade::Vector{FT} = zeros(FT, nLayer)
     "NPQ of shaded leaves"
-    NPQ_shade      ::Array{FT,1} = zeros(FT, nLayer)
+    NPQ_shade::Vector{FT} = zeros(FT, nLayer)
     # TODO remove these?
     "GPP of shaded leaves `[μmol m⁻² s⁻¹]`"
-    GPP_shade      ::Array{FT,1} = zeros(FT, nLayer)
+    GPP_shade::Vector{FT} = zeros(FT, nLayer)
     "gs of shaded leaves `[mol m⁻² s⁻¹]`"
-    gs_shade       ::Array{FT,1} = zeros(FT, nLayer)
+    gs_shade::Vector{FT} = zeros(FT, nLayer)
     "Leaf water potential of shaded leaves `[MPa]`"
-    ψl_shade       ::Array{FT,1} = zeros(FT, nLayer)
+    ψl_shade::Vector{FT} = zeros(FT, nLayer)
     "Cc of shaded leaves `[µmol/mol]`"
-    Cc_shade       ::Array{FT,1} = zeros(FT, nLayer)
+    Cc_shade::Vector{FT} = zeros(FT, nLayer)
     "internal CO₂ concentration of shaded leaves `[µmol/mol]`"
-    Pi_shade       ::Array{FT,1} = zeros(FT, nLayer)
+    Pi_shade::Vector{FT} = zeros(FT, nLayer)
 
     # Dimension of wavelength
     "Short-wave TOC outgoing radiance in observation direction `[mW m⁻² nm⁻¹ sr⁻¹]`"
-    Lo         ::Array{FT,1} = zeros(FT, nWL)
+    Lo::Vector{FT} = zeros(FT, nWL)
     "Short-wave TOC outgoing radiation `[mW m⁻² nm⁻¹]`"
-    Eout       ::Array{FT,1} = zeros(FT, nWL)
+    Eout::Vector{FT} = zeros(FT, nWL)
     "Short-wave Albedo in viewing direction"
-    alb_obs    ::Array{FT,1} = zeros(FT, nWL)
+    alb_obs::Vector{FT} = zeros(FT, nWL)
     "Short-wave Albedo for direct incoming radiation"
-    alb_direct ::Array{FT,1} = zeros(FT, nWL)
+    alb_direct::Vector{FT} = zeros(FT, nWL)
     "Short-wave Albedo for diffuse incoming radiation"
-    alb_diffuse::Array{FT,1} = zeros(FT, nWL)
+    alb_diffuse::Vector{FT} = zeros(FT, nWL)
 
     # Dimension of nLevel * nWavelengths
     "Upwelling diffuse short-wave radiation within canopy `[mW m⁻² nm⁻¹]`"
-    E_up  ::Array{FT,2} = zeros(FT, (nWL,nLevel))
+    E_up::Matrix{FT} = zeros(FT, (nWL,nLevel))
     "Downwelling diffuse short-wave radiation within canopy `[mW m⁻² nm⁻¹]`"
-    E_down::Array{FT,2} = zeros(FT, (nWL,nLevel))
+    E_down::Matrix{FT} = zeros(FT, (nWL,nLevel))
 
     # Dimension of nLayer * nWavelengths
     "Net absorbed direct radiation in each layer `[mW m⁻² nm⁻¹]`"
-    netSW_sunlit   ::Array{FT,2} = zeros(FT, (nWL,nLayer))
+    netSW_sunlit::Matrix{FT} = zeros(FT, (nWL,nLayer))
     "net absorbed diffuse radiation in each layer `[mW m⁻² nm⁻¹]`"
-    netSW_shade    ::Array{FT,2} = zeros(FT, (nWL,nLayer))
+    netSW_shade::Matrix{FT} = zeros(FT, (nWL,nLayer))
 
     # Dimension of nLeafInclination * nLeafAzimuth * nLayer
     "net PAR of sunlit leaves `[mol m⁻² s⁻¹]`"
-    absPAR_sun   ::Array{FT,3} = zeros(FT, (nIncl,nAzi,nLayer))
+    absPAR_sun::Array{FT,3} = zeros(FT, (nIncl,nAzi,nLayer))
     "net PAR by Cab+Car of sunlit leaves `[mol m⁻² s⁻¹]`"
     absPAR_sunCab::Array{FT,3} = zeros(FT, (nIncl,nAzi,nLayer))
     "Leaf temperature (sunlit) `[K]`"
-    T_sun3D      ::Array{FT,3} = zeros(FT, (nIncl,nAzi,nLayer)) .+ FT(298.15)
+    T_sun3D::Array{FT,3} = zeros(FT, (nIncl,nAzi,nLayer)) .+ 298.15
     "Fluorescence yield for sunlit leaves"
-    ϕ_sun        ::Array{FT,3} =  ones(FT, (nIncl,nAzi,nLayer)) .* FT(0.01)
+    ϕ_sun::Array{FT,3} =  ones(FT, (nIncl,nAzi,nLayer)) .* 0.01
     "Sensible Heat flux H of sunlit leaves `[W m⁻²]`"
-    H_sun        ::Array{FT,3} = zeros(FT, (nIncl,nAzi,nLayer))
+    H_sun::Array{FT,3} = zeros(FT, (nIncl,nAzi,nLayer))
     "Latent Heat flux LE of sunlit leaves `[W m⁻²]`"
-    LE_sun       ::Array{FT,3} = zeros(FT, (nIncl,nAzi,nLayer))
+    LE_sun::Array{FT,3} = zeros(FT, (nIncl,nAzi,nLayer))
     "NPQ of sunlit leaves"
-    NPQ_sun      ::Array{FT,3} = zeros(FT, (nIncl,nAzi,nLayer))
+    NPQ_sun::Array{FT,3} = zeros(FT, (nIncl,nAzi,nLayer))
     # TODO remove these?
     "GPP of sunlit leaves `[μmol m⁻² s⁻¹]`"
-    GPP_sun      ::Array{FT,3} = zeros(FT, (nIncl,nAzi,nLayer))
+    GPP_sun::Array{FT,3} = zeros(FT, (nIncl,nAzi,nLayer))
     "gs of sunlit leaves `[mol m⁻² s⁻¹]`"
-    gs_sun       ::Array{FT,3} = zeros(FT, (nIncl,nAzi,nLayer))
+    gs_sun::Array{FT,3} = zeros(FT, (nIncl,nAzi,nLayer))
     "Leaf water potential of sunlit leaves `[MPa]`"
-    ψl_sun       ::Array{FT,3} = zeros(FT, (nIncl,nAzi,nLayer))
+    ψl_sun::Array{FT,3} = zeros(FT, (nIncl,nAzi,nLayer))
     "Cc of sunlit leaves `[µmol/mol]`"
-    Cc_sun       ::Array{FT,3} = zeros(FT, (nIncl,nAzi,nLayer))
+    Cc_sun::Array{FT,3} = zeros(FT, (nIncl,nAzi,nLayer))
     "Internal CO₂ concentration of sunlit leaves `[µmol/mol]`"
-    Pi_sun       ::Array{FT,3} = zeros(FT, (nIncl,nAzi,nLayer))
+    Pi_sun::Array{FT,3} = zeros(FT, (nIncl,nAzi,nLayer))
 
     # Fluorescence Output:
     "Hemispheric total outgoing SIF flux `[mW m⁻² nm⁻¹]`)"
-    SIF_hemi         ::Array{FT,1} = zeros(FT, nWLF)
+    SIF_hemi::Vector{FT} = zeros(FT, nWLF)
     "Observer-direction outgoing SIF radiance (mW m⁻² nm⁻¹ sr⁻¹))"
-    SIF_obs          ::Array{FT,1} = zeros(FT, nWLF)
+    SIF_obs::Vector{FT} = zeros(FT, nWLF)
     "Observer-direction outgoing SIF radiance, sunlit leaves (mW m⁻² nm⁻¹ sr⁻¹)"
-    SIF_obs_sunlit   ::Array{FT,1} = zeros(FT, nWLF)
+    SIF_obs_sunlit::Vector{FT} = zeros(FT, nWLF)
     "Observer-direction outgoing SIF radiance, shaded leaves (mW m⁻² nm⁻¹ sr⁻¹)"
-    SIF_obs_shaded   ::Array{FT,1} = zeros(FT, nWLF)
+    SIF_obs_shaded::Vector{FT} = zeros(FT, nWLF)
     "Observer-direction outgoing SIF radiance, scattered (mW m⁻² nm⁻¹ sr⁻¹)"
-    SIF_obs_scattered::Array{FT,1} = zeros(FT, nWLF)
+    SIF_obs_scattered::Vector{FT} = zeros(FT, nWLF)
     "Observer-direction outgoing SIF radiance, soil-reflected (mW m⁻² nm⁻¹ sr⁻¹)"
-    SIF_obs_soil     ::Array{FT,1} = zeros(FT, nWLF)
+    SIF_obs_soil::Vector{FT} = zeros(FT, nWLF)
     "Total SIF sum of layer sources  `[mW m⁻² nm⁻¹]`)"
-    SIF_sum          ::Array{FT,1} = zeros(FT, nWLF)
+    SIF_sum::Vector{FT} = zeros(FT, nWLF)
 end
+
+CanopyRads{FT}(rt_dim::RTDimensions) where {FT} = (
+    (; nAzi, nIncl, nLayer, nLevel, nWL, nWLF) = rt_dim;
+
+    return CanopyRads{FT}(nAzi = nAzi, nIncl = nIncl, nLayer = nLayer, nLevel = nLevel, nWL = nWL, nWLF = nWLF)
+);
diff --git a/src/CanopyLayers/types/incomingrad.jl b/src/CanopyLayers/types/incomingrad.jl
index 89b8de3a..86d070a1 100644
--- a/src/CanopyLayers/types/incomingrad.jl
+++ b/src/CanopyLayers/types/incomingrad.jl
@@ -12,9 +12,13 @@ Incoming radiation information
 $(TYPEDFIELDS)
 """
 Base.@kwdef mutable struct IncomingRadiation{FT}
+    opti_file::String = LAND_2021
+
     # these should match the WL in wls
     "Direct incoming radiation `[mW m⁻² nm⁻¹]`"
-    E_direct ::Array{FT,1}
+    E_direct::Vector{FT} = read_nc(opti_file, "E_DIR")
     "Diffuse incoming radiation `[mW m⁻² nm⁻¹]`"
-    E_diffuse::Array{FT,1}
+    E_diffuse::Vector{FT} = read_nc(opti_file, "E_DIFF")
 end
+
+IncomingRadiation(wls::WaveLengths{FT}) where {FT} = IncomingRadiation{FT}(opti_file = wls.opti_file)
diff --git a/src/CanopyLayers/types/leafbios.jl b/src/CanopyLayers/types/leafbios.jl
index dd2f8556..5d787577 100644
--- a/src/CanopyLayers/types/leafbios.jl
+++ b/src/CanopyLayers/types/leafbios.jl
@@ -12,51 +12,63 @@ A struct of leaf biological parameters
 $(TYPEDFIELDS)
 """
 Base.@kwdef mutable struct LeafBios{FT}
+    # whether to prescribe the leaf reflectance and transmission
+    "Prescribe leaf reflectance and transmission"
+    prescribe::Bool = false
+    "Prescribed leaf reflectance at PAR and NIR ranges"
+    ρs::Vector{FT} = [0.07, 0.35]
+    "Prescribed leaf transmission at PAR and NIR ranges"
+    τs::Vector{FT} = [0.05, 0.10]
+
     # local storage of dimension information
     "Number of wave length"
-    nWL ::Int = 10
+    nWL::Int = 10
     "Number of wave length for excitation"
     nWLE::Int = 10
     "Number of wave length for SIF"
     nWLF::Int = 10
 
     "Leaf structure parameter"
-    N   ::FT = FT(1.4  )
+    N::FT = 1.4
     "Chlorophyll a+b content `[µg cm⁻²]`"
-    Cab ::FT = FT(40.0 )
+    Cab::FT = 40
     "Carotenoid content `[µg cm⁻²]`"
-    Car ::FT = FT(10.0 )
+    Car::FT = 10
     "Anthocynanin content `[µg cm⁻²]`"
-    Ant ::FT = FT(0.0  )
+    Ant::FT = 0
     "Senescent material fraction"
-    Cs  ::FT = FT(0.0  )
+    Cs::FT = 0
     "Equivalent water thickness `[cm]`"
-    Cw  ::FT = FT(0.009)
+    Cw::FT = 0.009
     "Dry matter content (dry leaf mass per unit area) `[g cm⁻²]`"
-    Cm  ::FT = FT(0.012)
+    Cm::FT = 0.012
     "Fractionation between Zeaxanthin and Violaxanthin in Car (1=all Zeaxanthin) (-)"
-    Cx  ::FT = FT(0.0  )
+    Cx::FT = 0
     "Leaf fluorescence efficiency (Fo standard)"
-    fqe ::FT = FT(1.0  )
+    fqe::FT = 1
     "Broadband thermal reflectance (-)"
-    ρ_LW::FT = FT(0.01 )
+    ρ_LW::FT = 0.01
     "Broadband thermal transmission (-)"
-    τ_LW::FT = FT(0.01 )
+    τ_LW::FT = 0.01
 
     "Shortwave leaf reflectance"
-    ρ_SW       ::Array{FT,1} = zeros(FT, nWL)
+    ρ_SW::Vector{FT} = zeros(FT, nWL)
     "Shortwave leaf transmission"
-    τ_SW       ::Array{FT,1} = zeros(FT, nWL)
+    τ_SW::Vector{FT} = zeros(FT, nWL)
     "Shortwave absorption"
-    α_SW       ::Vector{FT}  = zeros(FT, nWL)
+    α_SW::Vector{FT}  = zeros(FT, nWL)
     "Relative absorbtion by Chlorophyll+Car"
-    kChlrel    ::Array{FT,1} = zeros(FT, nWL)
-    "Relative absorbtion by Chlorophyll"
-    kChlrel_old::Array{FT,1} = zeros(FT, nWL)
+    kChlrel::Vector{FT} = zeros(FT, nWL)
     "Fluorescence excitation matrix backwards"
-    Mb         ::Array{FT,2} = zeros(FT,(nWLF,nWLE))
+    Mb::Matrix{FT} = zeros(FT,(nWLF,nWLE))
     "Fluorescence excitation matrix forwards"
-    Mf         ::Array{FT,2} = zeros(FT,(nWLF,nWLE))
+    Mf::Matrix{FT} = zeros(FT,(nWLF,nWLE))
     "Doubling adding layers"
-    ndub       ::Int = 10
+    ndub::Int = 10
 end
+
+LeafBios{FT}(rt_dim::RTDimensions) where {FT} = (
+    (; nWL, nWLE, nWLF) = rt_dim;
+
+    return LeafBios{FT}(nWL = nWL, nWLE = nWLE, nWLF = nWLF)
+);
diff --git a/src/CanopyLayers/types/leafopticals.jl b/src/CanopyLayers/types/leafopticals.jl
index 36c1d38d..2e55419d 100644
--- a/src/CanopyLayers/types/leafopticals.jl
+++ b/src/CanopyLayers/types/leafopticals.jl
@@ -12,17 +12,17 @@ Struct for leaf optical properties
 $(TYPEDFIELDS)
 """
 Base.@kwdef mutable struct LeafOpticals{FT}
+    opti_file::String
+
     # TODO Add explanations to each field
-    nr    ::Array{FT,1} = zeros(FT, 2)
-    Km    ::Array{FT,1} = zeros(FT, 2)
-    Kab   ::Array{FT,1} = zeros(FT, 2)
-    Kant  ::Array{FT,1} = zeros(FT, 2)
-    Kcar  ::Array{FT,1} = zeros(FT, 2)
-    Kw    ::Array{FT,1} = zeros(FT, 2)
-    KBrown::Array{FT,1} = zeros(FT, 2)
-    phi   ::Array{FT,1} = zeros(FT, 2)
-    KcaV  ::Array{FT,1} = zeros(FT, 2)
-    KcaZ  ::Array{FT,1} = zeros(FT, 2)
-    "Wave length `[nm]`, same as `WL` in [`WaveLengths`](@ref)`"
-    lambda::Array{FT,1} = zeros(FT, 2)
+    nr::Vector{FT} = read_nc(opti_file, "NR")
+    Km::Vector{FT} = read_nc(opti_file, "K_LMA")
+    Kab::Vector{FT} = read_nc(opti_file, "K_CAB")
+    Kant::Vector{FT} = read_nc(opti_file, "K_ANT")
+    Kw::Vector{FT} = read_nc(opti_file, "K_H₂O")
+    KBrown::Vector{FT} = read_nc(opti_file, "K_BROWN")
+    phi::Vector{FT} = read_nc(opti_file, "K_PS")
+    KcaV::Vector{FT} = read_nc(opti_file, "K_CAR_V")
+    KcaZ::Vector{FT} = read_nc(opti_file, "K_CAR_Z")
+    Kcar::Vector{FT} = (KcaV .+ KcaZ) ./ 2
 end
diff --git a/src/CanopyLayers/types/rtdims.jl b/src/CanopyLayers/types/rtdims.jl
index d7b54548..8f205ee5 100644
--- a/src/CanopyLayers/types/rtdims.jl
+++ b/src/CanopyLayers/types/rtdims.jl
@@ -13,19 +13,26 @@ $(TYPEDFIELDS)
 """
 Base.@kwdef mutable struct RTDimensions
     "Number of azimuth angles"
-    nAzi  ::Int = 36
+    nAzi::Int = 36
     "Number of inclination agles"
-    nIncl ::Int = 9
+    nIncl::Int = 9
     "Number of canopy layers"
     nLayer::Int = 5
     "Number of canopy layer boundaries nLayer+1"
     nLevel::Int = nLayer+1
     "Number of PAR wave lengths"
-    nPAR  ::Int = 10
+    nPAR::Int = 10
     "Number of wave lengths"
-    nWL   ::Int = 10
+    nWL::Int = 10
     "Number of wave length for excitation"
-    nWLE  ::Int = 10
+    nWLE::Int = 10
     "Number of wave lengths for SIF"
-    nWLF  ::Int = 10
+    nWLF::Int = 10
 end
+
+RTDimensions(can::Canopy4RT, wls::WaveLengths) = (
+    (; nAzi, nIncl, nLayer) = can;
+    (; nPAR, nWL, nWLE, nWLF) = wls;
+
+    return RTDimensions(nAzi = nAzi, nIncl = nIncl, nLayer = nLayer, nPAR = nPAR, nWL = nWL, nWLE = nWLE, nWLF = nWLF)
+);
diff --git a/src/CanopyLayers/types/soilopticals.jl b/src/CanopyLayers/types/soilopticals.jl
index 706bdb69..7bd0cc8d 100644
--- a/src/CanopyLayers/types/soilopticals.jl
+++ b/src/CanopyLayers/types/soilopticals.jl
@@ -16,6 +16,8 @@ mutable struct SoilOpticals{FT}
     T::FT
     "Soil color class"
     color::Int
+    "Whether to expand from broadband to hyperspectral"
+    hyperspectral::Bool
 
     # broad band showrtwave albedo
     "Shortwave albedo for NIR"
@@ -32,10 +34,6 @@ mutable struct SoilOpticals{FT}
     ε_SW::Vector{FT}
 
     # hyperspectral soil albedo
-    "Shortwave albedo matrix from 4 bands, wavelengths are 400:10:2500 nm"
-    SW_mat_raw_4::Matrix{FT}
-    "Shortwave albedo matrix from 2 bands, wavelengths are 400:10:2500 nm"
-    SW_mat_raw_2::Matrix{FT}
     "Shortwave albedo matrix from 4 bands with `WL` from [`WaveLengths`](@ref)"
     SW_mat_4::Matrix{FT}
     "Shortwave albedo matrix from 2 bands with `WL` from [`WaveLengths`](@ref)"
@@ -44,8 +42,6 @@ mutable struct SoilOpticals{FT}
     SW_vec_4::Vector{FT}
     "Shortwave albedo weight from 2 bands"
     SW_vec_2::Vector{FT}
-    "Shortwave albedo, wavelengths are 400:10:2500 nm"
-    ρ_SW_raw::Vector{FT}
 
     # hyperspectral longwave albedo
     "Longtwave albedo"
@@ -60,55 +56,19 @@ mutable struct SoilOpticals{FT}
     wet_NIR::FT
     "Mean value for day band 1 in PAR region"
     wet_PAR::FT
+end
 
-    # constructor
-    function SoilOpticals{FT}(wls::WaveLengths{FT}) where {FT<:AbstractFloat}
-        @unpack nWL, nWLF, sWL = wls;
-
-        # read data that has a 10 nm stepping
-        _dat = read_csv(SOIL_GSV);
-        _raw_4 = Matrix{FT}(_dat[:,2:end-1]);
-
-        # extend the data to 1 nm stepping by interpolating the data
-        _wlr = _dat.WL;
-        _wle = collect(400:2500.1);
-        _ext_4 = Matrix{FT}(undef, length(_wle), 4);
-        for _ie in 1:size(_ext_4,1)-1
-            _wl= _wle[_ie];
-            _ir = Int(fld(_wl - 400, 10)) + 1;
-            _a = (_wl - _wlr[_ir]) * 0.1;
-            _ext_4[_ie,:] .= (1-_a) .* _raw_4[_ir,:] .+ _a .* _raw_4[_ir+1,:];
-        end
-        _ext_4[end,:] = _raw_4[end,:];
-
-        # rescale the data to match the steppings of wavelength set
-        _res_4 = Matrix{FT}(undef, nWL, 4);
-
-        # fill in the arrays
-        for _i_res in 1:nWL
-            _wo = findall( (_wle .>= sWL[_i_res]) .& (_wle .< sWL[_i_res+1]) )
-            if length(_wo) == 0
-                @warn "Some wavelengths out of bounds $(string(sWL[_i_res]))";
-            end;
-            _res_4[_i_res,1] = mean( _ext_4[_wo,1] );
-            _res_4[_i_res,2] = mean( _ext_4[_wo,2] );
-            _res_4[_i_res,3] = mean( _ext_4[_wo,3] );
-            _res_4[_i_res,4] = mean( _ext_4[_wo,4] );
-        end
 
-        # 2 band values
-        _raw_2 = [_raw_4[:,1] _raw_4[:,end]];
-        _res_2 = [_res_4[:,1] _res_4[:,end]];
+# constructor
+SoilOpticals(wls::WaveLengths{FT}) where {FT<:AbstractFloat} = (
+    (; nWL, nWLF, opti_file) = wls;
 
-        # mean values for 2 bands
-        _dry_nir = mean( _raw_2[31:end,1] );
-        _dry_par = mean( _raw_2[1:31,1]   );
-        _wet_nir = mean( _raw_2[31:end,2] );
-        _wet_par = mean( _raw_2[1:31,2]   );
+    # rescale the data to match the steppings of wavelength set
+    _res_4 = FT[read_nc(opti_file, "GSV_1") read_nc(opti_file, "GSV_2") read_nc(opti_file, "GSV_3") read_nc(opti_file, "GSV_4")];
+    _res_2 = FT[_res_4[:,1] _res_4[:,end]];
 
-        return new(T₂₅(FT), 1, FT(0.2), FT(0.2), ones(FT,nWL)*FT(0.2),
-                   ones(FT,nWLF)*FT(0.2), ones(FT,nWL)*FT(0.8), _raw_4, _raw_2,
-                   _res_4, _res_2, ones(FT,4), ones(FT,2), ones(FT,211),
-                   FT[0.1], _dry_nir, _dry_par, _wet_nir, _wet_par)
-    end
-end
+    return SoilOpticals{FT}(T₂₅(FT), 1, true, FT(0.2), FT(0.2), ones(FT,nWL).*FT(0.2),
+                            ones(FT,nWLF)*FT(0.2), ones(FT,nWL).*FT(0.8),
+                            _res_4, _res_2, ones(FT,4), ones(FT,2),
+                            FT[0.1], FT(0.5), FT(0.5), FT(0.5), FT(0.5))
+);
diff --git a/src/CanopyLayers/types/wavelength.jl b/src/CanopyLayers/types/wavelength.jl
index d6a80b0e..cb3382a8 100644
--- a/src/CanopyLayers/types/wavelength.jl
+++ b/src/CanopyLayers/types/wavelength.jl
@@ -12,62 +12,64 @@ Struct for pre-set wave length parameters
 $(TYPEDFIELDS)
 """
 Base.@kwdef mutable struct WaveLengths{FT}
+    opti_file::String = LAND_2021
+
     # Wave length (WL) boundaries
     "Minimal WL for PAR `[nm]`"
-    minwlPAR::FT = FT(400.0)
+    minwlPAR::FT = 300
     "Maximal WL for PAR `[nm]`"
-    maxwlPAR::FT = FT(700.0)
+    maxwlPAR::FT = 750
     "Minimal WL for NIR `[nm]`"
-    minwlNIR::FT = FT(700.0)
+    minwlNIR::FT = 700
     "Maximal WL for NIR `[nm]`"
-    maxwlNIR::FT = FT(2500.0)
+    maxwlNIR::FT = 2500
     "Minimal WL for SIF excitation `[nm]`"
-    minwle  ::FT = FT(400.0)
+    minwle::FT = 300
     "Maximal WL for SIF excitation `[nm]`"
-    maxwle  ::FT = FT(750.0)
+    maxwle::FT = 750
     "Minimal WL for SIF emission/fluorescence `[nm]`"
-    minwlf  ::FT = FT(640.0)
+    minwlf::FT = 640
     "Maximal WL for SIF emission/fluorescence `[nm]` "
-    maxwlf  ::FT = FT(850.0)
+    maxwlf::FT = 850
 
     # Wave length lists
-    "Standard wave length `[nm]`"
-    sWL::Array{FT,1} = [collect(FT(400.0):FT(10.0):FT( 650.1));
-                        collect(FT(655.0):FT( 5.0):FT( 770.1));
-                        collect(FT(780.0):FT(25.0):FT(2400.1))]
     "Differential wavelength"
-    dWL::Array{FT,1} = diff(sWL)
+    dWL::Vector{FT} = read_nc(opti_file, "WL_UPPER") .- read_nc(opti_file, "WL_LOWER")
 
     "Leaf optical parameter set"
-    optis::LeafOpticals = LeafOpticals{FT}()
+    optis::LeafOpticals = LeafOpticals{FT}(opti_file = opti_file)
     "Wave length `[nm]`"
-    WL  ::Array{FT,1}  = optis.lambda
+    WL::Vector{FT} = read_nc(opti_file, "WL")
 
     "Index of WLE in WL"
-    iWLE::Array{Int,1} = findall( (WL .>= minwle) .& (WL .<= maxwle) )
+    iWLE::Vector{Int} = findall( (WL .>= minwle) .& (WL .<= maxwle) )
     "Index of WLF in WL"
-    iWLF::Array{Int,1} = findall( (WL .>= minwlf) .& (WL .<= maxwlf) )
+    iWLF::Vector{Int} = findall( (WL .>= minwlf) .& (WL .<= maxwlf) )
     "index of wlPAR in WL"
-    iPAR::Array{Int,1} = findall( (WL .>= minwlPAR) .& (WL .<= maxwlPAR) )
+    iPAR::Vector{Int} = findall( (WL .>= minwlPAR) .& (WL .<= maxwlPAR) )
+    "index of wlPAR in WL for 700 nm (regular definition)"
+    iPAR_700::Vector{Int} = findall( (WL .>= minwlPAR) .& (WL .<= 700) )
     "index of wlNIR in WL"
-    iNIR::Array{Int,1} = findall( (WL .>= minwlNIR) .& (WL .<= maxwlNIR) )
+    iNIR::Vector{Int} = findall( (WL .>= minwlNIR) .& (WL .<= maxwlNIR) )
 
     "excitation wave length `[nm]`"
-    WLE     ::Array{FT,1} = WL[iWLE]
+    WLE::Vector{FT} = WL[iWLE]
     "Fluorescence wave length `[nm]`"
-    WLF     ::Array{FT,1} = WL[iWLF]
+    WLF::Vector{FT} = WL[iWLF]
     "Wave length for PAR"
-    WL_iPAR ::Array{FT,1} = WL[iPAR];
+    WL_iPAR::Vector{FT} = WL[iPAR];
+    "Differential wave length for PAR"
+    dWL_iPAR::Vector{FT} = dWL[iPAR];
     "Differential wave length for PAR"
-    dWL_iPAR::Array{FT,1} = dWL[iPAR];
+    dWL_iPAR_700::Vector{FT} = dWL[iPAR_700];
     "Differential wave length for iWLE"
-    dWL_iWLE::Array{FT,1} = dWL[iWLE];
+    dWL_iWLE::Vector{FT} = dWL[iWLE];
 
     # local storage of dimension information
     "Length of WL_iPAR"
     nPAR::Int = length(iPAR)
     "Length of WL"
-    nWL ::Int = length(WL)
+    nWL::Int = length(WL)
     "length of WLE"
     nWLE::Int = length(iWLE)
     "length of WLF"
diff --git a/src/CanopyLayers/utils/dladgen.jl b/src/CanopyLayers/utils/dladgen.jl
index cefc3e9a..0db620a6 100644
--- a/src/CanopyLayers/utils/dladgen.jl
+++ b/src/CanopyLayers/utils/dladgen.jl
@@ -33,18 +33,12 @@ function dcum(a::FT, b::FT, t::FT) where {FT<:AbstractFloat}
 end
 
 
-
-
 """
-    dladgen(a::FT, b::FT, litab_bnd::Array{FT,2}) where {FT<:AbstractFloat}
+    dladgen(a::FT, b::FT, litab_bnd::Matrix{FT}) where {FT<:AbstractFloat}
 
 TODO Calculate the freqency of WHAT?
 """
-function dladgen(
-            a::FT,
-            b::FT,
-            litab_bnd::Array{FT,2}
-) where {FT<:AbstractFloat}
+function dladgen(a::FT, b::FT, litab_bnd::Matrix{FT}) where {FT<:AbstractFloat}
     @assert a + b <= 1;
     freq = similar(litab_bnd[:,1]);
     for i in eachindex(freq)
diff --git a/src/CanopyLayers/utils/e2phot.jl b/src/CanopyLayers/utils/e2phot.jl
index fd49c41c..47929fce 100644
--- a/src/CanopyLayers/utils/e2phot.jl
+++ b/src/CanopyLayers/utils/e2phot.jl
@@ -12,33 +12,20 @@ Calculates the number of moles of photons, given
 - `λ` An array of wave length in `[nm]`, converted to `[m]` by _FAC
 - `E` Joules of energy
 """
-function e2phot(
-            λ::Array{FT},
-            E::Array{FT}
-) where {FT<:AbstractFloat}
+function e2phot(λ::Array{FT}, E::Array{FT}) where {FT<:AbstractFloat}
     return (E .* λ) .* _FAC(FT)
 end
 
 
-
-
 """
-    e2phot!(
-                λ::Array{FT,1},
-                E::Array{FT,1},
-                cache::Array{FT,1}
-    ) where {FT<:AbstractFloat}
+    e2phot!(λ::Vector{FT}, E::Vector{FT}, cache::Vector{FT}) where {FT<:AbstractFloat}
 
 Calculates the number of moles of photons, given
 - `λ` An array of wave length in `[nm]`, converted to `[m]` by _FAC
 - `E` Joules of energy
 - `cache` Cache to avoid memory allocations
 """
-function e2phot!(
-            λ::Array{FT,1},
-            E::Array{FT,1},
-            cache::Array{FT,1}
-) where {FT<:AbstractFloat}
+function e2phot!(λ::Vector{FT}, E::Vector{FT}, cache::Vector{FT}) where {FT<:AbstractFloat}
     cache .= (E .* λ) .* _FAC(FT);
 
     return nothing
diff --git a/src/CanopyLayers/utils/psofunction.jl b/src/CanopyLayers/utils/psofunction.jl
index b867b4a5..4fe96225 100644
--- a/src/CanopyLayers/utils/psofunction.jl
+++ b/src/CanopyLayers/utils/psofunction.jl
@@ -4,35 +4,19 @@
 #
 ###############################################################################
 """
-    psofunction(K::FT,
-                k::FT,
-                Ω::FT,
-                LAI::FT,
-                q::FT,
-                dso::FT,
-                xl::FT
-    ) where {FT<:AbstractFloat}
+    psofunction(K::FT, k::FT, Ω::FT, LAI::FT, q::FT, dso::FT, xl::FT) where {FT<:AbstractFloat}
 
 # TODO explain the variables
 Return the probability of observing a sunlit leaf at depth `xl` (`pso`, see eq
     31 in vdT 2009), given
 - `xl` Leaf depth in the canopy
 """
-function psofunction(
-            K::FT,
-            k::FT,
-            Ω::FT,
-            LAI::FT,
-            q::FT,
-            dso::FT,
-            xl::FT
-) where {FT<:AbstractFloat}
+function psofunction(K::FT, k::FT, Ω::FT, LAI::FT, q::FT, dso::FT, xl::FT) where {FT<:AbstractFloat}
     # [nl+1]  factor for correlation of Ps and Po
     if dso != 0
         alf = dso / q * 2 / (k + K);
 
-        return exp( (K+k)*Ω*LAI*xl +
-                    sqrt(K*k)*Ω*LAI / alf * (1 - exp(xl*alf)) )
+        return exp( (K+k)*Ω*LAI*xl + sqrt(K*k)*Ω*LAI / alf * (1 - exp(xl*alf)) )
     else
         return exp( (K + k -sqrt(K*k)) * Ω * LAI * xl )
     end
diff --git a/src/CanopyLayers/utils/volscatt.jl b/src/CanopyLayers/utils/volscatt.jl
index 701f3bf7..7bbd40cd 100644
--- a/src/CanopyLayers/utils/volscatt.jl
+++ b/src/CanopyLayers/utils/volscatt.jl
@@ -4,12 +4,7 @@
 #
 ###############################################################################
 """
-    volscatt!(cache::Array{FT,1},
-              sza::FT,
-              vza::FT,
-              raa::FT,
-              ttl::FT
-    ) where {FT<:AbstractFloat}
+    volscatt!(cache::Vector{FT}, sza::FT, vza::FT, raa::FT, ttl::FT) where {FT<:AbstractFloat}
 
 Calculate interception parameters (`chi_s` and `chi_s`) and leaf reflectance
     multiplier (`frho`) and transmittance multiplier (`ftau`), given
@@ -19,13 +14,7 @@ Calculate interception parameters (`chi_s` and `chi_s`) and leaf reflectance
 - `raa` Relative azimuth angle
 - `ttl` Leaf inclination angle
 """
-function volscatt!(
-            cache::Array{FT,1},
-            sza::FT,
-            vza::FT,
-            raa::FT,
-            ttl::FT
-) where {FT<:AbstractFloat}
+function volscatt!(cache::Vector{FT}, sza::FT, vza::FT, raa::FT, ttl::FT) where {FT<:AbstractFloat}
     psi_rad = deg2rad(raa);
     cos_raa = cosd(raa);
     cos_ttl = cosd(ttl);
@@ -34,10 +23,10 @@ function volscatt!(
     sin_sza = sind(sza);
     cos_vza = cosd(vza);
     sin_vza = sind(vza);
-    Cs      = cos_ttl*cos_sza;
-    Ss      = sin_ttl*sin_sza;
-    Co      = cos_ttl*cos_vza;
-    So      = sin_ttl*sin_vza;
+    Cs = cos_ttl*cos_sza;
+    Ss = sin_ttl*sin_sza;
+    Co = cos_ttl*cos_vza;
+    So = sin_ttl*sin_vza;
 
     cosbts = FT(1.0);
     cosbto = FT(1.0);
diff --git a/src/Land.jl b/src/Land.jl
index d55cecdd..0b7b53c6 100644
--- a/src/Land.jl
+++ b/src/Land.jl
@@ -1,16 +1,14 @@
 module Land
 
+using Revise
+
 
 # include sub modules
-include("CanopyLayers/CanopyLayers.jl"                  )
-include("Photosynthesis/Photosynthesis.jl"              )
-include("PlantHydraulics/PlantHydraulics.jl"            )
-include("StomataModels/StomataModels.jl"                )
+include("CanopyLayers/CanopyLayers.jl")
+include("Photosynthesis/Photosynthesis.jl")
+include("PlantHydraulics/PlantHydraulics.jl")
+include("StomataModels/StomataModels.jl")
 include("SoilPlantAirContinuum/SoilPlantAirContinuum.jl")
 
-# include types
-include("Land/Types.jl"    )
-include("Land/AirLayers.jl")
-
 
 end # module
diff --git a/src/Land/AirLayers.jl b/src/Land/AirLayers.jl
deleted file mode 100644
index ab4205b2..00000000
--- a/src/Land/AirLayers.jl
+++ /dev/null
@@ -1,34 +0,0 @@
-#=
-###############################################################################
-#
-# run ODE on vertical layered trace gasses
-#
-###############################################################################
-"""
-    vertical_layers!(vls::VerticalLayers{FT}, t::FT) where {FT<:AbstractFloat}
-
-Update vertical trace gas information with time, given
-- `vls` [`VerticalLayers`](@ref) type struct
-- `t` Time since last update
-"""
-function vertical_layers!(
-            vls::VerticalLayers{FT},
-            t::FT
-) where {FT<:AbstractFloat}
-    # unpack parameters
-    @unpack d_CO₂, d_layer, p_CO₂, x_layer, Δ_CO₂ = vls;
-    bc = DirichletBC(FT(50), FT(30));
-    u0 = vls.p_CO₂;
-
-    # define step function, move out later
-    # very memory extensive for now
-    step(u,p,t) = Δ_CO₂ * bc * u .* d_CO₂ ./ x_layer ./ d_layer;
-    prob = ODEProblem(step, u0, (FT(0), t));
-    alg  = KenCarp4();
-    sol  = solve(prob, alg);
-
-    @show sol[end];
-
-    return nothing
-end
-=#
diff --git a/src/Land/Types.jl b/src/Land/Types.jl
deleted file mode 100644
index 2b86843c..00000000
--- a/src/Land/Types.jl
+++ /dev/null
@@ -1,37 +0,0 @@
-#=
-###############################################################################
-#
-# Layer of soil and air to run ODE
-#
-###############################################################################
-"""
-    mutable struct VerticalLayers{FT}
-
-Struct that store trace gas information along vertical layers.
-
-# Fields
-$(DocStringExtensions.FIELDS)
-"""
-Base.@kwdef mutable struct VerticalLayers{FT}
-    "Number of layers"
-    n_layer::Int = 20
-    "Thickness per layer"
-    d_layer::Array{FT,1} = FT[1 for i in 1:n_layer]
-    "Vertical distances among layers (0.5 for boundaries)"
-    x_layer::Array{FT,1} = FT[0.5; [1 for i in 1:n_layer-2]; 0.5]
-
-    # Temperature
-    "Temperature at each layer"
-    T::Array{FT,1} = ones(FT,n_layer) .* T_25(FT)
-
-    # CO₂ partial pressure
-    "Diffusion coefficient array"
-    d_CO₂::Array{FT,1} = diffusive_coefficient.(T,
-                                                [TraceGasCO₂()],
-                                                [TraceGasAir()])
-    "Vertical CO₂ partial pressure"
-    p_CO₂::Array{FT,1} = ones(FT,n_layer) .* 41
-    "derivative operator for CO₂ partial pressure"
-    Δ_CO₂::DerivativeOperator = CenteredDifference(2, 2, FT(1), n_layer)
-end
-=#
diff --git a/src/Photosynthesis/Photosynthesis.jl b/src/Photosynthesis/Photosynthesis.jl
index ce8dee65..f58f0ec2 100644
--- a/src/Photosynthesis/Photosynthesis.jl
+++ b/src/Photosynthesis/Photosynthesis.jl
@@ -3,7 +3,6 @@ module Photosynthesis
 using DocStringExtensions: TYPEDFIELDS
 using EmeraldConstants: GAS_R, RT₂₅, T₀, T₂₅
 using PkgUtility: lower_quadratic
-using UnPack: @unpack
 using WaterPhysics: saturation_vapor_pressure
 
 
diff --git a/src/Photosynthesis/fluorescence/fluorescence.jl b/src/Photosynthesis/fluorescence/fluorescence.jl
index ee32ec26..f9072e74 100644
--- a/src/Photosynthesis/fluorescence/fluorescence.jl
+++ b/src/Photosynthesis/fluorescence/fluorescence.jl
@@ -4,25 +4,16 @@
 #
 ###############################################################################
 """
-    leaf_fluorescence!(
-                fluo_set::CytoFluoParaSet{FT},
-                leaf::Leaf{FT}
-    ) where {FT<:AbstractFloat}
-    leaf_fluorescence!(
-                fluo_set::FluoParaSet{FT},
-                leaf::Leaf{FT}
-    ) where {FT<:AbstractFloat}
+    leaf_fluorescence!(fluo_set::CytoFluoParaSet{FT}, leaf::Leaf{FT}) where {FT<:AbstractFloat}
+    leaf_fluorescence!(fluo_set::FluoParaSet{FT}, leaf::Leaf{FT}) where {FT<:AbstractFloat}
 
 Compute fluorescence yield, Kr, Ks, and Kp for leaf, given
 - `fluo_set` [`FluoParaSet`](@ref) type parameter set
 - `leaf` [`Leaf`](@ref) struct
 """
-function leaf_fluorescence!(
-            fluo_set::CytoFluoParaSet{FT},
-            leaf::Leaf{FT}
-) where {FT<:AbstractFloat}
-    @unpack APAR, C_b₆f, J_P680_a, J_P700_a, J_P700_j, K_D1, K_F1, K_N1, K_P1,
-            K_P2, K_U2, k_q, φ_P1_max, α_1, α_2, ϵ_1, ϵ_2 = leaf;
+function leaf_fluorescence! end
+leaf_fluorescence!(fluo_set::CytoFluoParaSet{FT}, leaf::Leaf{FT}) where {FT<:AbstractFloat} = (
+    (; APAR, C_b₆f, J_P680_a, J_P700_a, J_P700_j, K_D1, K_F1, K_N1, K_P1, K_P2, K_U2, k_q, φ_P1_max, α_1, α_2, ϵ_1, ϵ_2) = leaf;
 
     # adapted from https://github.com/jenjohnson/johnson-berry-2021-pres/
     #                      scripts/model_fun.m
@@ -87,31 +78,25 @@ function leaf_fluorescence!(
     =#
 
     return nothing
-end
+);
 
-
-
-
-function leaf_fluorescence!(
-            fluo_set::FluoParaSet{FT},
-            leaf::Leaf{FT}
-) where {FT<:AbstractFloat}
-    @unpack Ag, Kd, Kf, Kp_max, maxPSII = leaf;
-    @unpack Kr1, Kr2, Kr3 = fluo_set;
+leaf_fluorescence!(fluo_set::FluoParaSet{FT}, leaf::Leaf{FT}) where {FT<:AbstractFloat} = (
+    (; Ag, Kd, Kf, Kp_max, maxPSII) = leaf;
+    (; Kr1, Kr2, Kr3) = fluo_set;
 
     # Actual effective ETR:
     leaf.Ja  = max(0, Ag / leaf.e2c);
 
     # Effective photochemical yield:
     if leaf.Ja <= 0
-        _φ   = maxPSII;
+        _φ = maxPSII;
     else
-        _φ   = maxPSII*leaf.Ja/leaf.J_pot;
-    end
+        _φ = maxPSII*leaf.Ja/leaf.J_pot;
+    end;
 
-    leaf.φ   = min(1/maxPSII, _φ);
+    leaf.φ = min(1/maxPSII, _φ);
     # degree of light saturation: 'x' (van der Tol e.Ap. 2014)
-    x        = max(0,  1-leaf.φ/maxPSII);
+    x = max(0,  1-leaf.φ/maxPSII);
 
     # Max PSII rate constant, x_α = exp(log(x)*Kr2);
     x_α      = x ^ Kr2;
@@ -137,4 +122,4 @@ function leaf_fluorescence!(
     leaf.NPQ = leaf.Kr / (Kf + Kd);
 
     return nothing
-end
+);
diff --git a/src/Photosynthesis/photosynthesis/etr.jl b/src/Photosynthesis/photosynthesis/etr.jl
index 37980a3d..dd5436fb 100644
--- a/src/Photosynthesis/photosynthesis/etr.jl
+++ b/src/Photosynthesis/photosynthesis/etr.jl
@@ -4,20 +4,19 @@
 #
 ###############################################################################
 """
-    leaf_ETR!(photo_set::AbstractPhotoModelParaSet{FT},
-              leaf::Leaf{FT}
-    ) where {FT<:AbstractFloat}
+    leaf_ETR!(photo_set::C3Cytochrome{FT}, leaf::Leaf{FT}) where {FT<:AbstractFloat}
+    leaf_ETR!(photo_set::C3ParaSet{FT}, leaf::Leaf{FT}) where {FT<:AbstractFloat}
+    leaf_ETR!(photo_set::C4ParaSet{FT}, leaf::Leaf{FT}) where {FT<:AbstractFloat}
 
 Update the electron transport variables in the leaf struct, given
-- `photo_set` [`C3ParaSet`](@ref) or [`C4ParaSet`](@ref) type struct
+- `photo_set` [`C3Cytochrome`](@ref), [`C3ParaSet`](@ref) or [`C4ParaSet`](@ref) type struct
 - `leaf` [`Leaf`](@ref) type struct
 """
-function leaf_ETR!(
-            photo_set::C3Cytochrome{FT},
-            leaf::Leaf{FT}
-) where {FT<:AbstractFloat}
-    @unpack APAR, K_P1, Vqmax, n_C, n_L, p_i, α_1, Γ_star, φ_P1_max = leaf;
-    @unpack Eff_1, Eff_2 = photo_set;
+function leaf_ETR! end
+
+leaf_ETR!(photo_set::C3Cytochrome{FT}, leaf::Leaf{FT}) where {FT<:AbstractFloat} = (
+    (; APAR, K_P1, Vqmax, n_C, n_L, p_i, α_1, Γ_star, φ_P1_max) = leaf;
+    (; Eff_1, Eff_2) = photo_set;
 
     # TODO note to run this function before rubisco_limited_rate!
     # TODO Is Vqmax necessary here, or we use Jmax as well
@@ -30,17 +29,11 @@ function leaf_ETR!(
     leaf.J = leaf.J_P680_j;
 
     return nothing
-end
-
-
-
+);
 
-function leaf_ETR!(
-            photo_set::C3ParaSet{FT},
-            leaf::Leaf{FT}
-) where {FT<:AbstractFloat}
-    @unpack APAR, maxPSII, Jmax, PSII_frac = leaf;
-    @unpack Θ_J = photo_set;
+leaf_ETR!(photo_set::C3ParaSet{FT}, leaf::Leaf{FT}) where {FT<:AbstractFloat} = (
+    (; APAR, maxPSII, Jmax, PSII_frac) = leaf;
+    (; Θ_J) = photo_set;
 
     _Jp = PSII_frac * maxPSII * APAR;
     _J  = lower_quadratic(Θ_J, -(_Jp + Jmax), _Jp * Jmax);
@@ -49,16 +42,10 @@ function leaf_ETR!(
     leaf.J     = _J;
 
     return nothing
-end
-
-
-
+);
 
-function leaf_ETR!(
-            photo_set::C4ParaSet{FT},
-            leaf::Leaf{FT}
-) where {FT<:AbstractFloat}
-    @unpack APAR, maxPSII, PSII_frac = leaf
+leaf_ETR!(photo_set::C4ParaSet{FT}, leaf::Leaf{FT}) where {FT<:AbstractFloat} = (
+    (; APAR, maxPSII, PSII_frac) = leaf;
 
     _Jp = PSII_frac * maxPSII * APAR;
 
@@ -66,4 +53,4 @@ function leaf_ETR!(
     leaf.J     = _Jp;
 
     return nothing
-end
+);
diff --git a/src/Photosynthesis/photosynthesis/lightlimited.jl b/src/Photosynthesis/photosynthesis/lightlimited.jl
index 851293c4..2dd6a9b3 100644
--- a/src/Photosynthesis/photosynthesis/lightlimited.jl
+++ b/src/Photosynthesis/photosynthesis/lightlimited.jl
@@ -27,8 +27,8 @@ function light_limited_rate!(
             photo_set::Union{C3Cytochrome{FT},C3ParaSet{FT}},
             leaf::Leaf{FT}
 ) where {FT<:AbstractFloat}
-    @unpack J, p_i, Γ_star = leaf;
-    @unpack Eff_1, Eff_2 = photo_set;
+    (; J, p_i, Γ_star) = leaf;
+    (; Eff_1, Eff_2) = photo_set;
 
     leaf.e2c = (p_i - Γ_star) / ( Eff_1*p_i + Eff_2*Γ_star );
     leaf.Aj  = J * leaf.e2c;
@@ -57,9 +57,9 @@ function light_limited_rate!(
             leaf::Leaf{FT},
             envir::AirLayer{FT}
 ) where {FT<:AbstractFloat}
-    @unpack g_lc, J, Rd, Γ_star = leaf;
-    @unpack p_a, p_atm = envir;
-    @unpack Eff_1, Eff_2 = photo_set;
+    (; g_lc, J, Rd, Γ_star) = leaf;
+    (; p_a, p_atm) = envir;
+    (; Eff_1, Eff_2) = photo_set;
 
     _a = J;
     _b = J * Γ_star;
diff --git a/src/Photosynthesis/photosynthesis/productlimited.jl b/src/Photosynthesis/photosynthesis/productlimited.jl
index 737a5e3e..eb561213 100644
--- a/src/Photosynthesis/photosynthesis/productlimited.jl
+++ b/src/Photosynthesis/photosynthesis/productlimited.jl
@@ -27,8 +27,8 @@ function product_limited_rate!(
             photo_set::C3Cytochrome{FT},
             leaf::Leaf{FT}
 ) where {FT<:AbstractFloat}
-    @unpack p_i, Vcmax, Γ_star = leaf;
-    @unpack Eff_1, Eff_2 = photo_set;
+    (; p_i, Vcmax, Γ_star) = leaf;
+    (; Eff_1, Eff_2) = photo_set;
 
     leaf.Ap = leaf.Vcmax / 2;
     leaf.J_P680_p = leaf.Ac * (Eff_1*p_i + Eff_2*Γ_star) / (p_i - Γ_star);
@@ -69,8 +69,8 @@ function product_limited_rate!(
             leaf::Leaf{FT},
             envir::AirLayer{FT}
 ) where {FT<:AbstractFloat}
-    @unpack g_lc, Kpep, Rd, Vpmax = leaf;
-    @unpack p_a, p_atm = envir;
+    (; g_lc, Kpep, Rd, Vpmax) = leaf;
+    (; p_a, p_atm) = envir;
 
     _a = Vpmax;
     _d = Kpep;
diff --git a/src/Photosynthesis/photosynthesis/rubiscolimited.jl b/src/Photosynthesis/photosynthesis/rubiscolimited.jl
index 563c9a5c..7d1bafff 100644
--- a/src/Photosynthesis/photosynthesis/rubiscolimited.jl
+++ b/src/Photosynthesis/photosynthesis/rubiscolimited.jl
@@ -27,8 +27,8 @@ function rubisco_limited_rate!(
             photo_set::C3Cytochrome{FT},
             leaf::Leaf{FT}
 ) where {FT<:AbstractFloat}
-    @unpack Km, p_i, Vcmax, Γ_star = leaf;
-    @unpack Eff_1, Eff_2 = photo_set;
+    (; Km, p_i, Vcmax, Γ_star) = leaf;
+    (; Eff_1, Eff_2) = photo_set;
 
     leaf.Ac = Vcmax * (p_i - Γ_star) / (p_i + Km);
     leaf.J_P680_c = leaf.Ac * (Eff_1*p_i + Eff_2*Γ_star) / (p_i - Γ_star);
@@ -44,7 +44,7 @@ function rubisco_limited_rate!(
             photo_set::C3ParaSet{FT},
             leaf::Leaf{FT}
 ) where {FT<:AbstractFloat}
-    @unpack Km, p_i, Vcmax, Γ_star = leaf;
+    (; Km, p_i, Vcmax, Γ_star) = leaf;
 
     leaf.Ac = Vcmax * (p_i - Γ_star) / (p_i + Km);
 
@@ -71,8 +71,8 @@ function rubisco_limited_rate!(
             leaf::Leaf{FT},
             envir::AirLayer{FT}
 ) where {FT<:AbstractFloat}
-    @unpack g_lc, Km, Rd, Vcmax, Γ_star = leaf;
-    @unpack p_a, p_atm = envir;
+    (; g_lc, Km, Rd, Vcmax, Γ_star) = leaf;
+    (; p_a, p_atm) = envir;
 
     _a = Vcmax;
     _b = Vcmax * Γ_star;
diff --git a/src/Photosynthesis/temperature/correction.jl b/src/Photosynthesis/temperature/correction.jl
index f63c3aa5..562f585d 100644
--- a/src/Photosynthesis/temperature/correction.jl
+++ b/src/Photosynthesis/temperature/correction.jl
@@ -45,7 +45,7 @@ function temperature_correction(
             td_set::ArrheniusPeakTD{FT},
             T::FT
 ) where {FT<:AbstractFloat}
-    @unpack C, ΔHa_to_RT25, ΔHd_to_R, ΔSv_to_R = td_set;
+    (; C, ΔHa_to_RT25, ΔHd_to_R, ΔSv_to_R) = td_set;
 
     # _f_a: activation correction, C/_f_b: de-activation correction
     _f_a::FT = exp( ΔHa_to_RT25 * (1 - T₂₅(FT)/T) );
diff --git a/src/Photosynthesis/temperature/dependency.jl b/src/Photosynthesis/temperature/dependency.jl
index 5f955c20..b7953d07 100644
--- a/src/Photosynthesis/temperature/dependency.jl
+++ b/src/Photosynthesis/temperature/dependency.jl
@@ -107,6 +107,24 @@ end
 
 
 
+"""
+    leaf_kd!(leaf::Leaf{FT}) where {FT<:AbstractFloat}
+
+Update leaf heat dissipation rate constant and maximal PSII yield, given
+- `leaf` [`Leaf`](@ref) type struct
+"""
+function leaf_kd!(leaf::Leaf{FT}) where {FT<:AbstractFloat}
+    if leaf.Kd_TD
+        leaf.Kd = max(0.8738, 0.0301 * (leaf.T - T₀()) + 0.0773);
+        leaf.maxPSII = leaf.Kp_max / (leaf.Kp_max + leaf.Kf + leaf.Kd);
+    end;
+
+    return nothing
+end
+
+
+
+
 """
     leaf_km!(photo_set::C3ParaSet{FT},
              leaf::Leaf{FT},
@@ -298,6 +316,7 @@ function leaf_temperature_dependence!(
         leaf_ko!(photo_set.KoT, leaf);
         leaf_km!(photo_set, leaf, envir);
         leaf_Γstar!(photo_set.ΓsT, leaf);
+        leaf_kd!(leaf);
     end
 
     return nothing
@@ -318,6 +337,7 @@ function leaf_temperature_dependence!(
         leaf_vcmax!(photo_set.VcT, leaf);
         leaf_vpmax!(photo_set.VpT, leaf);
         leaf_kpep!(photo_set.KpT, leaf);
+        leaf_kd!(leaf);
     end
 
     return nothing
diff --git a/src/Photosynthesis/types/leaf.jl b/src/Photosynthesis/types/leaf.jl
index e9934e32..e6a71572 100644
--- a/src/Photosynthesis/types/leaf.jl
+++ b/src/Photosynthesis/types/leaf.jl
@@ -32,9 +32,11 @@ Base.@kwdef mutable struct Leaf{FT<:AbstractFloat}
     "Maximal Kp"
     Kp_max::FT = 4
     "max PSII yield (Kr=0, all RC open)"
-    maxPSII::FT = Kp/(Kp+Kf+Kd)
+    maxPSII::FT = Kp_max/(Kp_max+Kf+Kd)
     "Fraction of absorbed light used by PSII ETR"
     PSII_frac::FT = 0.5
+    "Whether Kd is temperature dependent"
+    Kd_TD::Bool = false
 
     # CO₂ pressures
     "Leaf internal CO₂ partial pressure `[Pa]`"
diff --git a/src/Photosynthesis/types/parasets.jl b/src/Photosynthesis/types/parasets.jl
index ffaa585c..31a25187 100644
--- a/src/Photosynthesis/types/parasets.jl
+++ b/src/Photosynthesis/types/parasets.jl
@@ -241,7 +241,7 @@ function C3Bernacchi(FT)
     VR  = VtoRDefault(FT);
     E1  = FT(4);
     E2  = FT(8);
-    return C3ParaSet{FT}(JT, KcT, KoT, ReT, VcT, ΓsT, Flu, VR, E1, E2, 1)
+    return C3ParaSet{FT}(JT, KcT, KoT, ReT, VcT, ΓsT, Flu, VR, E1, E2, 0.7)
 end
 
 """ [`C3ParaSet`](@ref) type C3 photosynthesis using CLM5's data """
@@ -256,7 +256,7 @@ function C3CLM(FT)
     VR  = VtoRDefault(FT);
     E1  = FT(4);
     E2  = FT(8);
-    return C3ParaSet{FT}(JT, KcT, KoT, ReT, VcT, ΓsT, Flu, VR, E1, E2, 1)
+    return C3ParaSet{FT}(JT, KcT, KoT, ReT, VcT, ΓsT, Flu, VR, E1, E2, 0.7)
 end
 
 """ [`C4ParaSet`](@ref) type C4 photosynthesis using CLM5's data """
diff --git a/src/PlantHydraulics/PlantHydraulics.jl b/src/PlantHydraulics/PlantHydraulics.jl
index 20fa5938..a5d8edfa 100644
--- a/src/PlantHydraulics/PlantHydraulics.jl
+++ b/src/PlantHydraulics/PlantHydraulics.jl
@@ -9,12 +9,9 @@ using HypergeometricFunctions: _₂F₁
 using PkgUtility: twarn
 using SpecialFunctions: gamma
 using Statistics: mean
-using UnPack: @unpack
 using WaterPhysics: relative_surface_tension, relative_viscosity
 
 
-
-
 # export public types --- soil vulnerability
 export BrooksCorey, VanGenuchten
 
@@ -48,8 +45,6 @@ export flow_profile!, pressure_profile!, inititialize_legacy!, critical_flow,
        temperature_effects!, end_pressure, fit_xylem_VC
 
 
-
-
 include("types/curves.jl")
 include("types/flow.jl"  )
 include("types/organ.jl" )
@@ -72,6 +67,4 @@ include("hydraulics/temperature.jl")
 include("hydraulics/capacitance.jl")
 
 
-
-
 end # module
diff --git a/src/PlantHydraulics/curves/capacity.jl b/src/PlantHydraulics/curves/capacity.jl
index 689f761b..9f2e8302 100644
--- a/src/PlantHydraulics/curves/capacity.jl
+++ b/src/PlantHydraulics/curves/capacity.jl
@@ -29,7 +29,7 @@ function p_from_volume(
             rvol::FT,
             T::FT
 ) where {FT<:AbstractFloat}
-    @unpack c_all, RWC_apo, RWC_TLP, ϵ_bulk = pv;
+    (; c_all, RWC_apo, RWC_TLP, ϵ_bulk) = pv;
 
     if rvol > RWC_TLP
         return -c_all * GAS_R(FT) * T / (rvol - RWC_apo) * FT(1e-6) +
diff --git a/src/PlantHydraulics/curves/integral.jl b/src/PlantHydraulics/curves/integral.jl
index 0828c193..12e5afac 100644
--- a/src/PlantHydraulics/curves/integral.jl
+++ b/src/PlantHydraulics/curves/integral.jl
@@ -6,7 +6,7 @@ function vc_integral(
     @assert p_ups <= 0 && p_dos <= 0;
 
     # unpack data from VC
-    @unpack a,b = vc;
+    (; a, b) = vc;
     _t_dos = log(a * exp(b*p_dos) + 1);
     _t_ups = log(a * exp(b*p_ups) + 1);
 
@@ -27,7 +27,7 @@ function vc_integral(
     @assert p_ups <= 0 && p_dos <= 0;
 
     # unpack data from VC
-    @unpack a,b = vc;
+    (; a, b) = vc;
     _krghe = Kmax * ρg_MPa(FT) * h * (a+1) / a + E;
     _lower = b * _krghe;
     _multi = Kmax * (a+1) / a * E;
@@ -48,7 +48,7 @@ function vc_integral(
     @assert p_ups <= 0 && p_dos <= 0;
 
     # unpack data from vc
-    @unpack a,b = vc;
+    (; a, b) = vc;
     _f_dos = p_dos * _₂F₁(1, 1/b, 1+1/b, -a*(-p_dos)^b);
     _f_ups = p_ups * _₂F₁(1, 1/b, 1+1/b, -a*(-p_ups)^b);
 
@@ -69,7 +69,7 @@ function vc_integral(
     @assert p_ups <= 0 && p_dos <= 0;
 
     # unpack data from VC
-    @unpack a,b = vc;
+    (; a, b) = vc;
     _krghe = Kmax * ρg_MPa(FT) * h + E;
     _multi = Kmax * E / _krghe;
     _f_dos = p_dos * _₂F₁(1, 1/b, 1+1/b, -E * a * (-p_dos)^b / _krghe);
@@ -89,7 +89,7 @@ function vc_integral(
     @assert p_ups <= 0 && p_dos <= 0;
 
     # unpack data from VC
-    @unpack b,c = vc;
+    (; b, c) = vc;
 
     # compute the incomplete gamma function
     _Γ_dos = gamma(1/c, (-p_dos/b)^c);
diff --git a/src/PlantHydraulics/curves/soil.jl b/src/PlantHydraulics/curves/soil.jl
index a2580b11..34e76f1d 100644
--- a/src/PlantHydraulics/curves/soil.jl
+++ b/src/PlantHydraulics/curves/soil.jl
@@ -17,7 +17,7 @@ function soil_erwc(
             p_25::FT
 ) where {FT<:AbstractFloat}
     if p_25 < 0
-        @unpack b, ϕs = sh;
+        (; b, ϕs) = sh;
 
         return (-ϕs/p_25) ^ (1/b)
     else
@@ -33,7 +33,7 @@ function soil_erwc(
             p_25::FT
 ) where {FT<:AbstractFloat}
     if p_25 < 0
-        @unpack m, n, α = sh;
+        (; m, n, α) = sh;
 
         return ( 1 / ( 1 + (-p_25 * α) ^ n ) ) ^ m
     else
@@ -56,7 +56,7 @@ function soil_rwc(
             sh::BrooksCorey{FT},
             p_25::FT
 ) where {FT<:AbstractFloat}
-    @unpack Θs = sh;
+    (; Θs) = sh;
 
     return soil_swc(sh, p_25) / Θs
 end
@@ -68,7 +68,7 @@ function soil_rwc(
             sh::VanGenuchten{FT},
             p_25::FT
 ) where {FT<:AbstractFloat}
-    @unpack Θs = sh;
+(; Θs) = sh;
 
     return soil_swc(sh, p_25) / Θs
 end
@@ -88,7 +88,7 @@ function soil_swc(
             sh::BrooksCorey{FT},
             p_25::FT
 ) where {FT<:AbstractFloat}
-    @unpack Θr, Θs = sh;
+    (; Θr, Θs) = sh;
 
     return soil_erwc(sh, p_25) * (Θs - Θr) + Θr
 end
@@ -100,7 +100,7 @@ function soil_swc(
             sh::VanGenuchten{FT},
             p_25::FT
 ) where {FT<:AbstractFloat}
-    @unpack Θr, Θs = sh;
+    (; Θr, Θs) = sh;
 
     return soil_erwc(sh, p_25) * (Θs - Θr) + Θr
 end
@@ -143,7 +143,7 @@ function soil_k_ratio_erwc(
             sh::VanGenuchten{FT},
             erwc::FT
 ) where {FT<:AbstractFloat}
-    @unpack m = sh;
+    (; m) = sh;
     k_ratio = sqrt(erwc) * (1 - (1 - erwc^(1/m)) ^ m)^2;
 
     return max(k_ratio, FT(1e-20))
@@ -163,7 +163,7 @@ function soil_k_ratio_rwc(
             sh::BrooksCorey{FT},
             rwc::FT
 ) where {FT<:AbstractFloat}
-    @unpack Θr, Θs = sh;
+    (; Θr, Θs) = sh;
 
     erwc = min(1, max(0, (rwc * Θs - Θr) / (Θs - Θr)));
 
@@ -177,7 +177,7 @@ function soil_k_ratio_rwc(
             sh::VanGenuchten{FT},
             rwc::FT
 ) where {FT<:AbstractFloat}
-    @unpack Θr, Θs = sh;
+    (; Θr, Θs) = sh;
 
     erwc = min(1, max(0, (rwc * Θs - Θr) / (Θs - Θr)));
 
@@ -198,7 +198,7 @@ function soil_k_ratio_swc(
             sh::BrooksCorey{FT},
             swc::FT
 ) where {FT<:AbstractFloat}
-    @unpack Θr, Θs = sh;
+    (; Θr, Θs) = sh;
 
     erwc = min(1, max(0, (swc - Θr) / (Θs - Θr)));
 
@@ -212,7 +212,7 @@ function soil_k_ratio_swc(
             sh::VanGenuchten{FT},
             swc::FT
 ) where {FT<:AbstractFloat}
-    @unpack Θr, Θs = sh;
+    (; Θr, Θs) = sh;
 
     erwc = min(1, max(0, (swc - Θr) / (Θs - Θr)));
 
@@ -278,7 +278,7 @@ function soil_p_25_erwc(
             erwc::FT
 ) where {FT<:AbstractFloat}
     if erwc < 1
-        @unpack b, ϕs = sh;
+        (; b, ϕs) = sh;
 
         return -ϕs / (erwc ^ b)
     else
@@ -294,7 +294,7 @@ function soil_p_25_erwc(
             erwc::FT
 ) where {FT<:AbstractFloat}
     if erwc < 1
-        @unpack m, n, α = sh;
+        (; m, n, α) = sh;
 
         return -1 * (erwc ^ (-1/m) - 1) ^ (1/n) / α
     else
@@ -320,7 +320,7 @@ function soil_p_25_rwc(
             sh::BrooksCorey{FT},
             rwc::FT
 ) where {FT<:AbstractFloat}
-    @unpack Θr, Θs = sh;
+    (; Θr, Θs) = sh;
 
     erwc = min(1, max(0, (rwc * Θs - Θr) / (Θs - Θr)));
 
@@ -334,7 +334,7 @@ function soil_p_25_rwc(
             sh::VanGenuchten{FT},
             rwc::FT
 ) where {FT<:AbstractFloat}
-    @unpack Θr, Θs = sh;
+    (; Θr, Θs) = sh;
 
     erwc = min(1, max(0, (rwc * Θs - Θr) / (Θs - Θr)));
 
@@ -359,7 +359,7 @@ function soil_p_25_swc(
             sh::BrooksCorey{FT},
             swc::FT
 ) where {FT<:AbstractFloat}
-    @unpack Θr, Θs = sh;
+    (; Θr, Θs) = sh;
 
     erwc = min(1, max(0, (swc - Θr) / (Θs - Θr)));
 
@@ -373,7 +373,7 @@ function soil_p_25_swc(
             sh::VanGenuchten{FT},
             swc::FT
 ) where {FT<:AbstractFloat}
-    @unpack Θr, Θs = sh;
+    (; Θr, Θs) = sh;
 
     erwc = min(1, max(0, (swc - Θr) / (Θs - Θr)));
 
diff --git a/src/PlantHydraulics/curves/xylem.jl b/src/PlantHydraulics/curves/xylem.jl
index 6d212229..2832357e 100755
--- a/src/PlantHydraulics/curves/xylem.jl
+++ b/src/PlantHydraulics/curves/xylem.jl
@@ -25,7 +25,7 @@ function xylem_k_ratio(
         return 1 / vis
     end
 
-    @unpack a,b = vc;
+    (; a, b) = vc;
     return max( FT(1e-4), (1 - 1/(1 + a * exp(b * p_25))) * (a+1)/a ) / vis
 end
 
@@ -41,7 +41,7 @@ function xylem_k_ratio(
         return 1 / vis
     end
 
-    @unpack a,b = vc;
+    (; a, b) = vc;
     return max( FT(1e-4), 1 / (1 + a*(-p_25)^b) ) / vis
 end
 
@@ -53,7 +53,7 @@ function xylem_k_ratio(
             p_25::FT,
             vis::FT = FT(1)
 ) where {FT<:AbstractFloat}
-    @unpack b,c = vc;
+    (; b, c) = vc;
 
     if p_25<0
         kr = max( FT(1e-4), exp( -1 * (-p_25 / b) ^ c ) ) / vis;
@@ -72,7 +72,7 @@ function xylem_k_ratio(
             p_25::FT,
             vis::FT = FT(1)
 ) where {FT<:AbstractFloat}
-    @unpack b1,c1,f1,b2,c2,f2 = vc;
+    (; b1, c1, f1, b2, c2, f2) = vc;
 
     if p_25<0
         k1 = exp( -1 * (-p_25 / b1) ^ c1 ) * f1;
@@ -108,7 +108,7 @@ function xylem_p_crit(
             vc::WeibullSingle{FT},
             f_st::FT = FT(1)
 ) where {FT<:AbstractFloat}
-    @unpack b,c = vc;
+    (; b, c) = vc;
 
     return -b * log( FT(1000) ) ^ (1 / c) * f_st
 end
@@ -120,7 +120,7 @@ function xylem_p_crit(
             vc::WeibullDual{FT},
             f_st::FT = FT(1)
 ) where {FT<:AbstractFloat}
-    @unpack b1,c1,b2,c2 = vc;
+    (; b1, c1, b2, c2) = vc;
 
     p1 = -b1 * log( FT(1000) ) ^ (1 / c1) * f_st
     p2 = -b2 * log( FT(1000) ) ^ (1 / c2) * f_st
@@ -141,7 +141,7 @@ end
 #
 ###############################################################################
 
-function fit_xylem_VC(xs::Array{FT,1}, ys::Array{FT,1}; label="TPLC") where {FT<:AbstractFloat}
+function fit_xylem_VC(xs::Vector{FT}, ys::Vector{FT}; label="TPLC") where {FT<:AbstractFloat}
     _ps = xs;
     _ks = ys;
 
diff --git a/src/PlantHydraulics/hydraulics/capacitance.jl b/src/PlantHydraulics/hydraulics/capacitance.jl
index 164f50f5..5541e616 100644
--- a/src/PlantHydraulics/hydraulics/capacitance.jl
+++ b/src/PlantHydraulics/hydraulics/capacitance.jl
@@ -11,10 +11,10 @@
                 Δt::FT,
                 nss::Bool
     ) where {FT<:AbstractFloat}
-    update_PVF!(roots::Array{RootHydraulics{FT},1},
-                ks::Array{FT,1},
-                ps::Array{FT,1},
-                qs::Array{FT,1},
+    update_PVF!(roots::Vector{RootHydraulics{FT}},
+                ks::Vector{FT},
+                ps::Vector{FT},
+                qs::Vector{FT},
                 q_sum::FT,
                 Δt::FT
     ) where {FT<:AbstractFloat}
@@ -40,8 +40,7 @@ Note that this function only updates the equilibrium pressure in the tissue,
 """
 function update_PVF!(hs::LeafHydraulics{FT}, Δt::FT) where {FT<:AbstractFloat}
     # unpack values
-    @unpack f_vis, p_element, p_leaf, q_out, pv, T_sap, v_maximum,
-            v_storage = hs;
+    (; f_vis, p_element, p_leaf, q_out, pv, T_sap, v_maximum, v_storage) = hs;
 
     # calculate the flow rate out of the capacitance
     # use buffer_rate here to avoid alloaction issues
@@ -63,8 +62,7 @@ end
 
 function update_PVF!(hs::StemHydraulics{FT}, Δt::FT) where {FT<:AbstractFloat}
     # unpack values
-    @unpack f_vis, N, q_element, p_element, p_storage, pv, q_out, T_sap,
-            v_maximum, v_storage = hs;
+    (; f_vis, N, q_element, p_element, p_storage, pv, q_out, T_sap, v_maximum, v_storage) = hs;
 
     # update flow rate in, storage volume and pressure per slice
     f_sum::FT = 0;
@@ -89,8 +87,7 @@ end
 
 function update_PVF!(hs::RootHydraulics{FT}, Δt::FT) where {FT<:AbstractFloat}
     # unpack values
-    @unpack f_vis, N, p_element, p_storage, pv, q_buffer, q_diff, q_element,
-            q_out, T_sap, v_maximum, v_storage = hs;
+    (; f_vis, N, p_element, p_storage, pv, q_buffer, q_diff, q_element, q_out, T_sap, v_maximum, v_storage) = hs;
 
     # update flow rate in, storage volume and pressure per slice
     f_sum::FT = 0;
@@ -121,14 +118,12 @@ function update_PVF!(
             nss::Bool
 ) where {FT<:AbstractFloat}
     # unpack values
-    @unpack f_vis, N, p_element, p_storage, pv, q_buffer, q_diff, q_element,
-            q_out, v_maximum, v_storage = hs;
+    (; f_vis, N, p_element, p_storage, pv, q_buffer, q_diff, q_element, q_out, v_maximum, v_storage) = hs;
 
     # update flow rate in, storage volume and pressure per slice
     f_sum::FT = 0;
     for i in N:-1:1
-        f_cap = (p_storage[i] - p_element[i]) * buffer_rate(pv) /f_vis *
-                v_maximum[i];
+        f_cap = (p_storage[i] - p_element[i]) * buffer_rate(pv) /f_vis * v_maximum[i];
         if (f_cap > 0) && (v_storage[i] <= f_cap * Δt)
             f_cap = v_storage[i] / Δt;
         end
@@ -144,10 +139,10 @@ end
 
 
 function update_PVF!(
-            roots::Array{RootHydraulics{FT},1},
-            cache_k::Array{FT,1},
-            cache_p::Array{FT,1},
-            cache_q::Array{FT,1},
+            roots::Vector{RootHydraulics{FT}},
+            cache_k::Vector{FT},
+            cache_p::Vector{FT},
+            cache_q::Vector{FT},
             q_sum::FT,
             Δt::FT
 ) where {FT<:AbstractFloat}
@@ -211,8 +206,7 @@ function update_PVF!(
             tree::GrassLikeOrganism{FT},
             Δt::FT
 ) where {FT<:AbstractFloat}
-    @unpack cache_k, cache_p, cache_q, roots = tree;
-    leaves = tree.leaves;
+    (; cache_k, cache_p, cache_q, leaves, roots) = tree;
 
     # 0. note that leaf flow rates need to be updated outside this function
     # 1. update leaf PVF for each layer
@@ -238,9 +232,7 @@ function update_PVF!(
             tree::PalmLikeOrganism{FT},
             Δt::FT
 ) where {FT<:AbstractFloat}
-    @unpack cache_k, cache_p, cache_q, roots = tree;
-    leaves = tree.leaves;
-    trunk = tree.trunk;
+    (; cache_k, cache_p, cache_q, leaves, roots, trunk) = tree;
 
     # 0. note that leaf flow rates need to be updated outside this function
     # 1. update leaf PVF for each layer
@@ -251,11 +243,11 @@ function update_PVF!(
     end
 
     # 2. update PVF for trunk
-    trunk.q_out = f_sum;
+    (trunk).q_out = f_sum;
     update_PVF!(trunk, Δt);
 
     # 3. update flow rate for roots, partition total flow rates into roots
-    update_PVF!(roots, cache_k, cache_p, cache_q, trunk.q_in, Δt);
+    update_PVF!(roots, cache_k, cache_p, cache_q, (trunk).q_in, Δt);
 
     # 4. update pressure profiles
     pressure_profile!(tree, NonSteadyStateMode(); update=false);
@@ -270,8 +262,7 @@ function update_PVF!(
             tree::TreeLikeOrganism{FT},
             Δt::FT
 ) where {FT<:AbstractFloat}
-    @unpack branch, cache_k, cache_p, cache_q, leaves, roots = tree;
-    trunk = tree.trunk;
+    (; branch, cache_k, cache_p, cache_q, leaves, roots, trunk) = tree;
 
     # 0. note that leaf flow rates need to be updated outside this function
     # 1. update leaf and stem PVF for each layer
@@ -286,11 +277,11 @@ function update_PVF!(
     end
 
     # 2. update PVF for trunk
-    trunk.q_out = f_sum;
+    (trunk).q_out = f_sum;
     update_PVF!(trunk, Δt);
 
     # 3. update flow rate for roots, partition total flow rates into roots
-    update_PVF!(roots, cache_k, cache_p, cache_q, trunk.q_in, Δt);
+    update_PVF!(roots, cache_k, cache_p, cache_q, (trunk).q_in, Δt);
 
     # 4. update pressure profiles
     pressure_profile!(tree, NonSteadyStateMode(); update=false);
diff --git a/src/PlantHydraulics/hydraulics/conductance.jl b/src/PlantHydraulics/hydraulics/conductance.jl
index c4ef58bc..69024e0a 100644
--- a/src/PlantHydraulics/hydraulics/conductance.jl
+++ b/src/PlantHydraulics/hydraulics/conductance.jl
@@ -61,7 +61,7 @@ end
     ) where {FT<:AbstractFloat}
     root_pk(root::RootHydraulics{FT},
             q_in::FT,
-            flow::Array{FT,1}
+            flow::Vector{FT}
     ) where {FT<:AbstractFloat}
 
 Return root xylem end pressure and root hydraulic conductance (reverse of
@@ -75,8 +75,7 @@ function root_pk(
             root::RootHydraulics{FT},
             flow::FT
 ) where {FT<:AbstractFloat}
-    @unpack f_st, f_vis, k_element, k_history, k_rhiz, p_gravity, p_history,
-            p_osm, p_ups, sh, T_sap, vc = root;
+    (; f_st, f_vis, k_element, k_history, k_rhiz, p_gravity, p_history, p_osm, p_ups, sh, T_sap, vc) = root;
 
     # make sure that p_ups is not p_25 and then convert
     p_end::FT = p_ups;
@@ -119,10 +118,9 @@ end
 function root_pk(
             root::RootHydraulics{FT},
             q_in::FT,
-            flow::Array{FT,1}
+            flow::Vector{FT}
 ) where {FT<:AbstractFloat}
-    @unpack f_st, f_vis, k_element, k_history, k_rhiz, p_gravity, p_history,
-            p_osm, p_ups, sh, T_sap, vc = root;
+    (; f_st, f_vis, k_element, k_history, k_rhiz, p_gravity, p_history, p_osm, p_ups, sh, T_sap, vc) = root;
 
     # make sure that p_ups is not p_25 and then convert
     p_end::FT = p_ups;
@@ -183,7 +181,7 @@ function xylem_risk(
             hs::LeafHydraulics{FT},
             flow::FT
 ) where {FT<:AbstractFloat}
-    @unpack f_st, f_vis, vc = hs;
+    (; f_st, f_vis, vc) = hs;
 
     p_25 = end_pressure(hs, flow) / hs.f_st;
     θ_25 = xylem_k_ratio(vc, p_25, f_vis);
diff --git a/src/PlantHydraulics/hydraulics/flow.jl b/src/PlantHydraulics/hydraulics/flow.jl
index aa6469a1..57dfc115 100644
--- a/src/PlantHydraulics/hydraulics/flow.jl
+++ b/src/PlantHydraulics/hydraulics/flow.jl
@@ -111,17 +111,17 @@ end
 #
 ###############################################################################
 """
-    roots_flow!(roots::Array{RootHydraulics{FT},1},
-                ks::Array{FT,1},
-                ps::Array{FT,1},
-                qs::Array{FT,1},
+    roots_flow!(roots::Vector{RootHydraulics{FT}},
+                ks::Vector{FT},
+                ps::Vector{FT},
+                qs::Vector{FT},
                 flow::FT,
                 recalculate::Bool
     ) where {FT<:AbstractFloat}
-    roots_flow!(roots::Array{RootHydraulics{FT},1},
-                ks::Array{FT,1},
-                ps::Array{FT,1},
-                qs::Array{FT,1},
+    roots_flow!(roots::Vector{RootHydraulics{FT}},
+                ks::Vector{FT},
+                ps::Vector{FT},
+                qs::Vector{FT},
                 flow::FT
     ) where {FT<:AbstractFloat}
     roots_flow!(plant::Union{GrassLikeOrganism{FT},
@@ -141,10 +141,10 @@ Recalculate the flow rates in the root from the pressure and conductance
 - `plant` [`AbstractPlantOrganism`](@ref) type struct
 """
 function roots_flow!(
-            roots::Array{RootHydraulics{FT},1},
-            ks::Array{FT,1},
-            ps::Array{FT,1},
-            qs::Array{FT,1},
+            roots::Vector{RootHydraulics{FT}},
+            ks::Vector{FT},
+            ps::Vector{FT},
+            qs::Vector{FT},
             flow::FT,
             recalculate::Bool
 ) where {FT<:AbstractFloat}
@@ -177,10 +177,10 @@ end
 
 
 function roots_flow!(
-            roots::Array{RootHydraulics{FT},1},
-            ks::Array{FT,1},
-            ps::Array{FT,1},
-            qs::Array{FT,1},
+            roots::Vector{RootHydraulics{FT}},
+            ks::Vector{FT},
+            ps::Vector{FT},
+            qs::Vector{FT},
             flow::FT
 ) where {FT<:AbstractFloat}
     count = 0
diff --git a/src/PlantHydraulics/hydraulics/pressure.jl b/src/PlantHydraulics/hydraulics/pressure.jl
index d8d49b07..0d994bf4 100644
--- a/src/PlantHydraulics/hydraulics/pressure.jl
+++ b/src/PlantHydraulics/hydraulics/pressure.jl
@@ -45,7 +45,7 @@ function end_pressure(
             leaf::LeafHydraulics{FT},
             flow::FT
 ) where {FT<:AbstractFloat}
-    @unpack f_st, f_vis, k_element, k_history, p_history, p_ups, vc = leaf;
+    (; f_st, f_vis, k_element, k_history, p_history, p_ups, vc) = leaf;
 
     p_end::FT = p_ups;
 
@@ -70,8 +70,7 @@ function end_pressure(
             root::RootHydraulics{FT},
             flow::FT
 ) where {FT<:AbstractFloat}
-    @unpack f_st, f_vis, k_element, k_history, k_rhiz, p_gravity, p_history,
-            p_osm, p_ups, sh, T_sap, vc = root;
+    (; f_st, f_vis, k_element, k_history, k_rhiz, p_gravity, p_history, p_osm, p_ups, sh, T_sap, vc) = root;
 
     # make sure that p_ups is not p_25 and then convert
     p_end::FT = p_ups;
@@ -109,8 +108,7 @@ function end_pressure(
             stem::StemHydraulics{FT},
             flow::FT
 ) where {FT<:AbstractFloat}
-    @unpack f_st, f_vis, k_element, k_history, p_gravity, p_history, p_ups,
-            vc = stem;
+    (; f_st, f_vis, k_element, k_history, p_gravity, p_history, p_ups, vc) = stem;
 
     p_end::FT = p_ups;
 
@@ -201,7 +199,7 @@ end
     pressure_profile!(
                 root::RootHydraulics{FT},
                 q_in::FT,
-                flow::Array{FT,1};
+                flow::Vector{FT};
                 update::Bool = true
     ) where {FT<:AbstractFloat}
     pressure_profile!(
@@ -211,7 +209,7 @@ end
     ) where {FT<:AbstractFloat}
     pressure_profile!(
                 stem::StemHydraulics{FT},
-                flow::Array{FT,1};
+                flow::Vector{FT};
                 update::Bool = true
     ) where {FT<:AbstractFloat}
     pressure_profile!(
@@ -250,7 +248,7 @@ function pressure_profile!(
     # update leaf flow
     leaf.flow = flow;
 
-    @unpack k_element, k_history, p_history, p_ups, f_st, f_vis, vc = leaf;
+    (; k_element, k_history, p_history, p_ups, f_st, f_vis, vc) = leaf;
 
     p_end::FT = p_ups;
 
@@ -293,8 +291,7 @@ function pressure_profile!(
     # update root flow rate
     root.flow = flow;
 
-    @unpack f_st, f_vis, k_element, k_history, k_rhiz, p_gravity, p_history,
-            p_osm, p_ups, sh, T_sap, vc = root;
+    (; f_st, f_vis, k_element, k_history, k_rhiz, p_gravity, p_history, p_osm, p_ups, sh, T_sap, vc) = root;
 
     # make sure that p_ups is not p_25 and then convert
     p_end::FT = p_ups;
@@ -345,11 +342,10 @@ end
 function pressure_profile!(
             root::RootHydraulics{FT},
             q_in::FT,
-            flow::Array{FT,1};
+            flow::Vector{FT};
             update::Bool = true
 ) where {FT<:AbstractFloat}
-    @unpack f_st, f_vis, k_element, k_history, k_rhiz, p_gravity, p_history,
-            p_osm, p_ups, sh, T_sap, vc = root;
+    (; f_st, f_vis, k_element, k_history, k_rhiz, p_gravity, p_history, p_osm, p_ups, sh, T_sap, vc) = root;
 
     # make sure that p_ups is not p_25 and then convert
     p_end::FT = p_ups;
@@ -405,8 +401,7 @@ function pressure_profile!(
     # update stem flow
     stem.flow = flow;
 
-    @unpack f_st, f_vis, k_element, k_history, p_gravity, p_history, p_ups,
-            vc = stem;
+    (; f_st, f_vis, k_element, k_history, p_gravity, p_history, p_ups, vc) = stem;
 
     p_end::FT = p_ups;
 
@@ -442,11 +437,10 @@ end
 
 function pressure_profile!(
             stem::StemHydraulics{FT},
-            flow::Array{FT,1};
+            flow::Vector{FT};
             update::Bool = true
 ) where {FT<:AbstractFloat}
-    @unpack f_st, f_vis, k_element, k_history, p_gravity, p_history, p_ups,
-            vc = stem;
+    (; f_st, f_vis, k_element, k_history, p_gravity, p_history, p_ups, vc) = stem;
 
     p_end::FT = p_ups;
 
@@ -662,9 +656,7 @@ function pressure_profile!(
             mode::NonSteadyStateMode;
             update::Bool = false
 ) where {FT<:AbstractFloat}
-    @unpack branch, leaves = tree;
-    roots = tree.roots;
-    trunk = tree.trunk;
+    (; branch, leaves, roots, trunk) = tree;
 
     # update the profile in roots
     p_mean::FT = 0;
@@ -675,14 +667,14 @@ function pressure_profile!(
     p_mean /= length(roots);
 
     # update the profile in trunk
-    trunk.p_ups = p_mean;
-    pressure_profile!(trunk, trunk.q_element; update=update);
+    (trunk).p_ups = p_mean;
+    pressure_profile!(trunk, (trunk).q_element; update=update);
 
     # update the profile in leaf
     for i in eachindex(leaves)
         stem = branch[i];
         leaf = leaves[i];
-        stem.p_ups = trunk.p_dos;
+        stem.p_ups = (trunk).p_dos;
         pressure_profile!(stem, stem.q_element; update=update);
         leaf.p_ups = stem.p_dos;
         pressure_profile!(leaf, leaf.q_in; update=update);
@@ -699,7 +691,7 @@ function pressure_profile!(
             mode::SteadyStateMode;
             update::Bool = false
 ) where {FT<:AbstractFloat}
-    @unpack branch, leaves = tree;
+    (; branch, leaves) = tree;
     roots = tree.roots;
     trunk = tree.trunk;
 
diff --git a/src/PlantHydraulics/initialize/plant.jl b/src/PlantHydraulics/initialize/plant.jl
index 4db01192..ffa7e801 100644
--- a/src/PlantHydraulics/initialize/plant.jl
+++ b/src/PlantHydraulics/initialize/plant.jl
@@ -7,8 +7,8 @@
     create_grass(
                 z_root::FT,
                 z_canopy::FT,
-                soil_bounds::Array{FT,1},
-                air_bounds::Array{FT,1}
+                soil_bounds::Vector{FT},
+                air_bounds::Vector{FT}
     ) where {FT<:AbstractFloat}
 
 Create a [`GrassLikeOrganism`](@ref), given
@@ -20,8 +20,8 @@ Create a [`GrassLikeOrganism`](@ref), given
 function create_grass(
             z_root::FT,
             z_canopy::FT,
-            soil_bounds::Array{FT,1},
-            air_bounds::Array{FT,1}
+            soil_bounds::Vector{FT},
+            air_bounds::Vector{FT}
 ) where {FT<:AbstractFloat}
     # determine how many layers in roots and canopy
     _n_root  = 0;
@@ -82,8 +82,8 @@ end
     create_palm(z_root::FT,
                 z_trunk::FT,
                 z_canopy::FT,
-                soil_bounds::Array{FT,1},
-                air_bounds::Array{FT,1}
+                soil_bounds::Vector{FT},
+                air_bounds::Vector{FT}
     ) where {FT<:AbstractFloat}
 
 Create a [`PalmLikeOrganism`](@ref), given
@@ -97,8 +97,8 @@ function create_palm(
             z_root::FT,
             z_trunk::FT,
             z_canopy::FT,
-            soil_bounds::Array{FT,1},
-            air_bounds::Array{FT,1}
+            soil_bounds::Vector{FT},
+            air_bounds::Vector{FT}
 ) where {FT<:AbstractFloat}
     # determine how many layers in roots and canopy
     _n_root  = 0;
@@ -177,8 +177,8 @@ end
     create_tree(z_root::FT,
                 z_trunk::FT,
                 z_canopy::FT,
-                soil_bounds::Array{FT,1},
-                air_bounds::Array{FT,1}
+                soil_bounds::Vector{FT},
+                air_bounds::Vector{FT}
     ) where {FT<:AbstractFloat}
 
 Create a [`TreeLikeOrganism`](@ref), given
@@ -192,8 +192,8 @@ function create_tree(
             z_root::FT,
             z_trunk::FT,
             z_canopy::FT,
-            soil_bounds::Array{FT,1},
-            air_bounds::Array{FT,1}
+            soil_bounds::Vector{FT},
+            air_bounds::Vector{FT}
 ) where {FT<:AbstractFloat}
     # determine how many layers in roots and canopy
     _n_root  = 0;
diff --git a/src/PlantHydraulics/initialize/soil.jl b/src/PlantHydraulics/initialize/soil.jl
index f6e1b022..904a12b6 100644
--- a/src/PlantHydraulics/initialize/soil.jl
+++ b/src/PlantHydraulics/initialize/soil.jl
@@ -85,6 +85,18 @@ function create_soil_VC(
             vc::AbstractSoilVC{FT},
             name::String
 ) where {FT<:AbstractFloat}
+    @assert name in ["Sand",
+                     "Loamy Sand",
+                     "Sandy Loam",
+                     "Loam",
+                     "Sandy Clay Loam",
+                     "Silt Loam",
+                     "Silt",
+                     "Clay Loam",
+                     "Silty Clay Loam",
+                     "Sandy Clay",
+                     "Silty Clay",
+                     "Clay"] "Soil type $(name) not recognized!";
     # Parameters from Silt soil
     paras = [ 163.2656, 1.37, 0.46, 0.034];
 
@@ -112,9 +124,7 @@ function create_soil_VC(
         paras = [  51.0205, 1.09, 0.36, 0.070];
     elseif name=="Clay"
         paras = [  81.6328, 1.09, 0.38, 0.068];
-    else
-        @warn twarn("Soil type $(name) not recognized, use Silt instead.");
-    end
+    end;
 
     return create_soil_VC(vc, name, paras...)
 end
diff --git a/src/PlantHydraulics/types/organ.jl b/src/PlantHydraulics/types/organ.jl
index 5c835bab..4627124d 100644
--- a/src/PlantHydraulics/types/organ.jl
+++ b/src/PlantHydraulics/types/organ.jl
@@ -57,13 +57,13 @@ Base.@kwdef mutable struct LeafHydraulics{FT} <: AbstractHydraulicOrgan{FT}
 
     # pressure, k, and p_history profile
     "List of leaf k_max per element `[mol s⁻¹ MPa⁻¹ m⁻²]`"
-    k_element::Array{FT,1} =  ones(FT,N) .* N .* k_sla
+    k_element::Vector{FT} =  ones(FT,N) .* N .* k_sla
     "List of leaf kr history per element"
-    k_history::Array{FT,1} =  ones(FT,N)
+    k_history::Vector{FT} =  ones(FT,N)
     "List of xylem water pressure `[MPa]`"
-    p_element::Array{FT,1} = zeros(FT,N)
+    p_element::Vector{FT} = zeros(FT,N)
     "List of xylem water pressure history (normalized to 298.15 K) `[MPa]`"
-    p_history::Array{FT,1} = zeros(FT,N)
+    p_history::Vector{FT} = zeros(FT,N)
 
     # temperature related (uniform leaf temperature), update with time
     "Relative surface tension"
@@ -137,15 +137,15 @@ Base.@kwdef mutable struct RootHydraulics{FT} <: AbstractHydraulicOrgan{FT}
 
     # pressure, k, and p_history profile
     "List of k_max per element `[mol s⁻¹ MPa⁻¹ m⁻²]`"
-    k_element::Array{FT,1} =  ones(FT,N) .* N .* k_max
+    k_element::Vector{FT} =  ones(FT,N) .* N .* k_max
     "List of kr history per element"
-    k_history::Array{FT,1} =  ones(FT,N)
+    k_history::Vector{FT} =  ones(FT,N)
     "List of xylem water pressure `[MPa]`"
-    p_element::Array{FT,1} = zeros(FT,N)
+    p_element::Vector{FT} = zeros(FT,N)
     "List of pressure drop caused by gravity `[MPa]`"
-    p_gravity::Array{FT,1} = zeros(FT,N) .+ ρg_MPa(FT) .* Δh ./ N;
+    p_gravity::Vector{FT} = zeros(FT,N) .+ ρg_MPa(FT) .* Δh ./ N;
     "List of xylem water pressure history (normalized to 298.15 K) `[MPa]`"
-    p_history::Array{FT,1} = zeros(FT,N)
+    p_history::Vector{FT} = zeros(FT,N)
 
     # temperature related (uniform temperature), update with time
     "Relative surface tension"
@@ -161,17 +161,17 @@ Base.@kwdef mutable struct RootHydraulics{FT} <: AbstractHydraulicOrgan{FT}
     "Pressure volume curve for storage"
     pv::AbstractCapacity{FT} = PVCurveLinear{FT}()
     "Pressure of storage per element"
-    p_storage::Array{FT,1} = zeros(FT,N)
+    p_storage::Vector{FT} = zeros(FT,N)
     "Maximal storage per element `[mol]`"
-    v_maximum::Array{FT,1} = area * Δh / N * 6000 * ones(FT,N)
+    v_maximum::Vector{FT} = area * Δh / N * 6000 * ones(FT,N)
     "Storage per element `[mol]`"
-    v_storage::Array{FT,1} = area * Δh / N * 6000 * ones(FT,N)
+    v_storage::Vector{FT} = area * Δh / N * 6000 * ones(FT,N)
     "List of xylem water flow `[mol m⁻²]`"
-    q_element::Array{FT,1} = zeros(FT,N)
+    q_element::Vector{FT} = zeros(FT,N)
     "List of buffer water flow `[mol m⁻²]`"
-    q_buffer ::Array{FT,1} = zeros(FT,N)
+    q_buffer ::Vector{FT} = zeros(FT,N)
     "List of diiferntial water flow `[mol m⁻²]`"
-    q_diff   ::Array{FT,1} = zeros(FT,N)
+    q_diff   ::Vector{FT} = zeros(FT,N)
     "Flow rate into the tissue (used for non-steady state) `[mol s⁻¹]`"
     q_in ::FT = 0
     "Flow rate out of the tissue (used for non-steady state) `[mol s⁻¹]`"
@@ -215,15 +215,15 @@ Base.@kwdef mutable struct StemHydraulics{FT} <: AbstractHydraulicOrgan{FT}
 
     # pressure, k, and p_history profile
     "List of k_max per element `[mol s⁻¹ MPa⁻¹ m⁻²]`"
-    k_element::Array{FT,1} =  ones(FT,N) .* N .* k_max
+    k_element::Vector{FT} =  ones(FT,N) .* N .* k_max
     "List of kr history per element"
-    k_history::Array{FT,1} =  ones(FT,N)
+    k_history::Vector{FT} =  ones(FT,N)
     "List of xylem water pressure `[MPa]`"
-    p_element::Array{FT,1} = zeros(FT,N)
+    p_element::Vector{FT} = zeros(FT,N)
     "List of pressure drop caused by gravity `[MPa]`"
-    p_gravity::Array{FT,1} = zeros(FT,N) .+ ρg_MPa(FT) .* Δh ./ N;
+    p_gravity::Vector{FT} = zeros(FT,N) .+ ρg_MPa(FT) .* Δh ./ N;
     "List of xylem water pressure history (normalized to 298.15 K) `[MPa]`"
-    p_history::Array{FT,1} = zeros(FT,N)
+    p_history::Vector{FT} = zeros(FT,N)
 
     # temperature related (uniform temperature), update with time
     "Relative surface tension"
@@ -239,13 +239,13 @@ Base.@kwdef mutable struct StemHydraulics{FT} <: AbstractHydraulicOrgan{FT}
     "Pressure volume curve for storage"
     pv::AbstractCapacity{FT} = PVCurveLinear{FT}()
     "Pressure of storage per element"
-    p_storage::Array{FT,1} = zeros(FT,N)
+    p_storage::Vector{FT} = zeros(FT,N)
     "Maximal storage per element `[mol]`"
-    v_maximum::Array{FT,1} = area * Δh / N * 6000 * ones(FT,N)
+    v_maximum::Vector{FT} = area * Δh / N * 6000 * ones(FT,N)
     "Storage per element `[mol]`"
-    v_storage::Array{FT,1} = area * Δh / N * 6000 * ones(FT,N)
+    v_storage::Vector{FT} = area * Δh / N * 6000 * ones(FT,N)
     "List of xylem water flow `[mol m⁻²]`"
-    q_element::Array{FT,1} = zeros(FT,N)
+    q_element::Vector{FT} = zeros(FT,N)
     "Flow rate into the tissue (used for non-steady state) `[mol s⁻¹]`"
     q_in ::FT = 0
     "Flow rate out of the tissue (used for non-steady state) `[mol s⁻¹]`"
diff --git a/src/PlantHydraulics/types/plant.jl b/src/PlantHydraulics/types/plant.jl
index 1112a653..d4ef1623 100644
--- a/src/PlantHydraulics/types/plant.jl
+++ b/src/PlantHydraulics/types/plant.jl
@@ -34,23 +34,23 @@ mutable struct GrassLikeOrganism{FT} <: AbstractPlantOrganism{FT}
 
     # Arrays of roots and leaves
     "Roots system"
-    roots ::Array{RootHydraulics{FT},1}
+    roots ::Vector{RootHydraulics{FT}}
     "Leaves"
-    leaves::Array{LeafHydraulics{FT},1}
+    leaves::Vector{LeafHydraulics{FT}}
 
     # Root and canopy index in Soil and Atmosphere
     "Corresponding soil layer per root layer"
-    root_index_in_soil ::Array{Int,1}
+    root_index_in_soil ::Vector{Int}
     "Corresponding air layer per canopy layer"
-    canopy_index_in_air::Array{Int,1}
+    canopy_index_in_air::Vector{Int}
 
     # containers for root flows
     "Conductances for each layer at given flow"
-    cache_k::Array{FT,1}
+    cache_k::Vector{FT}
     "Pressure for each layer at given flow"
-    cache_p::Array{FT,1}
+    cache_p::Vector{FT}
     "Flow rate"
-    cache_q::Array{FT,1}
+    cache_q::Vector{FT}
 end
 
 
@@ -74,25 +74,25 @@ mutable struct PalmLikeOrganism{FT} <: AbstractPlantOrganism{FT}
 
     # Arrays of roots and leaves
     "Roots system"
-    roots ::Array{RootHydraulics{FT},1}
+    roots ::Vector{RootHydraulics{FT}}
     "Trunk"
     trunk ::StemHydraulics{FT}
     "Leaves"
-    leaves::Array{LeafHydraulics{FT},1}
+    leaves::Vector{LeafHydraulics{FT}}
 
     # Root and canopy index in Soil and Atmosphere
     "Corresponding soil layer per root layer"
-    root_index_in_soil ::Array{Int,1}
+    root_index_in_soil ::Vector{Int}
     "Corresponding air layer per canopy layer"
-    canopy_index_in_air::Array{Int,1}
+    canopy_index_in_air::Vector{Int}
 
     # containers for root flows
     "Conductances for each layer at given flow"
-    cache_k::Array{FT,1}
+    cache_k::Vector{FT}
     "Pressure for each layer at given flow"
-    cache_p::Array{FT,1}
+    cache_p::Vector{FT}
     "Flow rate"
-    cache_q::Array{FT,1}
+    cache_q::Vector{FT}
 end
 
 
@@ -116,27 +116,27 @@ mutable struct TreeLikeOrganism{FT} <: AbstractPlantOrganism{FT}
 
     # Arrays of roots and leaves
     "Roots system"
-    roots ::Array{RootHydraulics{FT},1}
+    roots ::Vector{RootHydraulics{FT}}
     "Trunk"
     trunk ::StemHydraulics{FT}
     "Branch system"
-    branch::Array{StemHydraulics{FT},1}
+    branch::Vector{StemHydraulics{FT}}
     "Leaves"
-    leaves::Array{LeafHydraulics{FT},1}
+    leaves::Vector{LeafHydraulics{FT}}
 
     # Root and canopy index in Soil and Atmosphere
     "Corresponding soil layer per root layer"
-    root_index_in_soil ::Array{Int,1}
+    root_index_in_soil ::Vector{Int}
     "Corresponding air layer per canopy layer"
-    canopy_index_in_air::Array{Int,1}
+    canopy_index_in_air::Vector{Int}
 
     # containers for root flows
     "Conductances for each layer at given flow"
-    cache_k::Array{FT,1}
+    cache_k::Vector{FT}
     "Pressure for each layer at given flow"
-    cache_p::Array{FT,1}
+    cache_p::Vector{FT}
     "Flow rate"
-    cache_q::Array{FT,1}
+    cache_q::Vector{FT}
 end
 
 
@@ -162,5 +162,5 @@ Base.@kwdef mutable struct TreeSimple{FT} <: AbstractPlantOrganism{FT}
 
     # Local container for tree information
     "Relative hydraulic conductance"
-    krs::Array{FT,1} = ones(FT,4)
+    krs::Vector{FT} = ones(FT,4)
 end
diff --git a/src/SoilPlantAirContinuum/SoilPlantAirContinuum.jl b/src/SoilPlantAirContinuum/SoilPlantAirContinuum.jl
index eb5c5a2f..725de480 100644
--- a/src/SoilPlantAirContinuum/SoilPlantAirContinuum.jl
+++ b/src/SoilPlantAirContinuum/SoilPlantAirContinuum.jl
@@ -1,16 +1,14 @@
 module SoilPlantAirContinuum
 
 using ConstrainedRootSolvers: ReduceStepMethodND, SolutionToleranceND, find_peak
-using DataFrames: DataFrame
 using DocStringExtensions: TYPEDFIELDS
 using EmeraldConstants: GAS_R, GRAVITY, K_STEFAN, K_VON_KARMAN, M_H₂O, P_ATM, RT₂₅, T₀, T₂₅, YEAR_D, ρ_H₂O
 using PkgUtility: numerical∫, tinfo
-using UnPack: @unpack
 using WaterPhysics: latent_heat_vapor, relative_diffusive_coefficient, saturation_vapor_pressure
 
-using ..CanopyLayers: Canopy4RT, CanopyOpticals, CanopyRads, IncomingRadiation, LeafBios, RTCache, RTDimensions, SIF_fluxes!, SoilOpticals, SolarAngles, WaveLengths, big_leaf_partition, canopy_fluxes!,
-      canopy_geometry!, canopy_matrices!, create_canopy_opticals, create_canopy_rads, create_canopy_rt, create_incoming_radiation, create_leaf_bios, create_rt_cache, create_rt_dims,
-      create_wave_length, fluspect!, short_wave!, thermal_fluxes!
+using ..CanopyLayers: LAND_2017, LAND_2021
+using ..CanopyLayers: Canopy4RT, CanopyOpticals, CanopyRads, IncomingRadiation, LeafBios, RTCache, RTDimensions, SIF_fluxes!, SoilOpticals, SolarAngles, WaveLengths,
+      canopy_fluxes!, canopy_geometry!, canopy_matrices!, fluspect!, short_wave!, thermal_fluxes!
 using ..Photosynthesis: AbstractPhotoModelParaSet, AirLayer, C3CLM, C3ParaSet, C4ParaSet, GCO₂Mode, Leaf, leaf_photosynthesis!, leaf_rd!, leaf_temperature_dependence!
 using ..PlantHydraulics: GrassLikeOrganism, PalmLikeOrganism, SteadyStateMode, TreeLikeOrganism, TreeSimple, create_grass, critical_flow, end_pressure, flow_profile!,
       pressure_profile!, roots_flow!, soil_p_25_swc, soil_swc, temperature_effects!
@@ -24,36 +22,22 @@ KG_2_MOL(FT)     = 1 / M_H₂O(FT);
 KG_H_2_MOL_S(FT) = KG_2_MOL(FT) / 3600;
 
 
-include("types/container.jl" )
-include("types/spacmono.jl"  )
-include("types/spacsimple.jl")
-
-include("bigleaf/gainriskmap.jl"   )
-include("bigleaf/gasexchange.jl"   )
-include("bigleaf/leafallocation.jl")
-include("bigleaf/optimizeflow.jl"  )
-include("bigleaf/optimizehs.jl"    )
-include("bigleaf/optimizeleaf.jl"  )
-include("bigleaf/partition.jl"     )
-include("bigleaf/temperature.jl"   )
-include("bigleaf/varytrait.jl"     )
-
-include("layers/beta.jl"        )
-include("layers/layer_fluxes.jl")
-include("layers/initializert.jl")
-include("layers/measures.jl"    )
-include("layers/test_diurnal.jl")
-include("layers/test_soil.jl"   )
-include("layers/windspeed.jl"   )
-
-include("planet/atmpressure.jl")
-include("planet/solarangle.jl" )
-
-include("simulation/annualprofit.jl"    )
-include("simulation/annualsimulation.jl")
-include("simulation/createdataframe.jl" )
-
-include("soil/moisture.jl")
+include("types/spacmono.jl");
+
+include("layers/beta.jl");
+include("layers/layer_fluxes.jl");
+include("layers/initializert.jl");
+include("layers/test_diurnal.jl");
+include("layers/test_soil.jl");
+include("layers/windspeed.jl");
+
+include("planet/atmpressure.jl");
+include("planet/solarangle.jl");
+
+include("quantities/measures.jl");
+include("quantities/photosynthesis.jl");
+
+include("wind.jl");
 
 
 end # module
diff --git a/src/SoilPlantAirContinuum/bigleaf/gainriskmap.jl b/src/SoilPlantAirContinuum/bigleaf/gainriskmap.jl
deleted file mode 100644
index 53a76623..00000000
--- a/src/SoilPlantAirContinuum/bigleaf/gainriskmap.jl
+++ /dev/null
@@ -1,105 +0,0 @@
-###############################################################################
-#
-# Create a matrix to show the sunlit-shaded partition algorithm
-#
-###############################################################################
-"""
-    gain_risk_map(
-                node::SPACSimple{FT},
-                photo_set::AbstractPhotoModelParaSet{FT}
-    ) where {FT<:AbstractFloat}
-
-Return the matrix of optimizers at different sunlit and shaded layer flow
-    rates, given
-- `node` [`SPACSimple`] type struct
-- `photo_set` [`AbstractPhotoModelParaSet`] type photosynthesis parameter set
-"""
-function gain_risk_map(
-            node::SPACSimple{FT},
-            photo_set::AbstractPhotoModelParaSet{FT}
-) where {FT<:AbstractFloat}
-    # 0. unpack required variables
-    @unpack frac_sh, frac_sl = node.container2L;
-
-    # 1. calculate the critical flow rate
-    node.ec = critical_flow(node.hs, node.ec);
-
-    # 2. find the maximal rates
-    max_f_sl = node.ec * frac_sl;
-    max_f_sh = node.ec * frac_sh;
-    f_sl = FT(0);
-    f_sh = FT(0);
-    list_f_sl = FT[0];
-    list_f_sh = FT[0];
-
-    # 3. initialize the matrix
-    leaf_gas_exchange_nonopt!(node, photo_set, f_sl, f_sh);
-    mat = node.containerOP /  node.ec;
-
-    # 4. expand the matrix
-    judge_sl = true;
-    judge_sh = true;
-    Δf = FT(0.1);
-    while judge_sl || judge_sh
-        # 4.1 if sunlit f_sl can be higher
-        tmp_list = [];
-        if judge_sl
-            f_sl += Δf;
-            f_sl >= max_f_sl ? (judge_sl=false; break) : nothing;
-
-            # 4.1.1 iterate through the list_f_sh
-            for tmp_f_sh in list_f_sh
-                leaf_gas_exchange_nonopt!(node, photo_set, f_sl, tmp_f_sh);
-                ele = node.containerOP / node.ec;
-
-                # expand the tmp_list horizontally
-                if tmp_list==[]
-                    tmp_list = ele;
-                else
-                    tmp_list = [tmp_list ele];
-                end
-            end
-
-            # 4.1.2 break if all -Inf
-            if all( tmp_list .< -999 )
-                judge_sl = false;
-            end
-        end
-
-        # 4.2 expand the matrix vertically
-        if judge_sl
-            mat = [mat; tmp_list];
-            push!(list_f_sl, f_sl);
-        end
-
-        # 4.3 if shaded f_sh can be higher
-        tmp_list = []
-        if judge_sh
-            f_sh += Δf;
-            f_sh >= max_f_sh ? (judge_sh=false; break) : nothing;
-
-            # 4.3.1 iterate through the list_f_sl
-            for tmp_f_sl in list_f_sl
-                leaf_gas_exchange_nonopt!(node, photo_set, tmp_f_sl, f_sh);
-                ele = node.containerOP / node.ec;
-
-                # expand the tmp_list vertically
-                push!(tmp_list, ele);
-            end
-
-            # 4.3.2 break if all -Inf
-            if all( tmp_list .< -999 )
-                judge_sh = false;
-            end
-        end
-
-        # 4.4 expand the matrix horizontally
-        if judge_sh
-            mat = [mat tmp_list];
-            push!(list_f_sh, f_sh);
-        end
-    end
-
-    # return the matrix, size(mat)[1] for sunlit, [2] for shaded
-    return mat
-end
diff --git a/src/SoilPlantAirContinuum/bigleaf/gasexchange.jl b/src/SoilPlantAirContinuum/bigleaf/gasexchange.jl
deleted file mode 100644
index 40e07f9b..00000000
--- a/src/SoilPlantAirContinuum/bigleaf/gasexchange.jl
+++ /dev/null
@@ -1,285 +0,0 @@
-###############################################################################
-#
-# Calculate gas exchange from flow rate only for required parameters
-#
-###############################################################################
-"""
-    leaf_gas_exchange_nonopt!(
-                node::SPACSimple{FT},
-                photo_set::AbstractPhotoModelParaSet{FT},
-                flow::FT,
-                par::FT,
-                rad::FT,
-                la::FT,
-                container::SPACContainer1L{FT}
-    ) where {FT<:AbstractFloat}
-    leaf_gas_exchange_nonopt!(
-                node::SPACSimple{FT},
-                photo_set::AbstractPhotoModelParaSet{FT},
-                flow::FT
-    ) where {FT<:AbstractFloat}
-    leaf_gas_exchange_nonopt!(
-                node::SPACSimple{FT},
-                photo_set::AbstractPhotoModelParaSet{FT},
-                f_sl::FT,
-                f_sh::FT
-    ) where {FT<:AbstractFloat}
-
-Simulate leaf level gas exchange and fill it into the `container` for 1-layer
-    or 2-layer canopy, given
-- `node` [`SPACSimple`] type struct
-- `photo_set` [`AbstractPhotoModelParaSet`] type struct
-- `flow` Flow rate per basal area into the leaves (e.g., for sunlit leaves)
-- `f_sl` Flow rate per basal area into the sunlit leaves
-- `f_sh` Flow rate per basal area into the shaded leaves
-- `par` Leaf-level photosynthetic active radiation
-- `rad` Leaf-level absorbed radiative energy
-- `la` Leaf area of the leaves (total or each layer)
-- `container` [`SPACContainer1L`] type container
-"""
-function leaf_gas_exchange_nonopt!(
-            node::SPACSimple{FT},
-            photo_set::AbstractPhotoModelParaSet{FT},
-            flow::FT,
-            par::FT,
-            rad::FT,
-            la::FT,
-            container::SPACContainer1L{FT}
-) where {FT<:AbstractFloat}
-    # if flow < 0
-    if flow < 0
-        container.an = FT(-Inf);
-
-    # if flow >= 0
-    else
-        # 0. unpack required variables
-        @unpack envir, g_max, width = node;
-        @unpack p_atm, p_H₂O, t_air, wind = envir;
-
-        # 1. calculate leaf temperature from the flow rate
-        t_leaf = max(200, leaf_temperature(node, rad, flow));
-
-        # 2. update leaf photosynthetic variables and leaf-to-air VPD
-        node.ps.APAR = par;
-        leaf_temperature_dependence!(photo_set, node.ps, envir, t_leaf);
-        d_leaf = node.ps.p_sat - p_H₂O;
-
-        # 3. update f_vis and f_st in leaf and calculate water potentials
-        # TODO do not account for temperature effects for flow now
-        # More reasonable functions need to be added
-        # vc_temperature_effects!(node.hs.leaf, t_leaf);
-
-        # if flow == 0
-        if flow == 0
-            g_lw = FT(0);
-            g_lc = FT(1e-6);
-            leaf_photosynthesis!(photo_set, node.ps, envir, GCO₂Mode(), g_lc);
-            container.an = node.ps.An;
-
-        # if flow > 0 and reasonable
-        elseif (d_leaf > 0) && (t_leaf > T₀(FT))
-            t_cor = relative_diffusive_coefficient( (t_leaf+t_air)/2 );
-            g_lw  = flow / la / d_leaf * p_atm;
-            g_bw  = boundary_layer_conductance(wind, width);
-            g_bc  = g_bw / FT(1.35);
-            g_sw  = 1 / (1/g_lw - 1/(g_bw*t_cor));
-            g_sc  = g_sw / FT(1.6);
-            g_lc  = max(FT(1e-6), 1 / (1/g_bc + 1/g_sc));
-            g_lim = 1 / (1/g_bw + 1/g_max);
-            if g_lw < g_lim * t_cor
-                leaf_photosynthesis!(photo_set, node.ps, envir, GCO₂Mode(),
-                                     g_lc);
-                container.an = node.ps.An;
-            else
-                container.an = FT(-Inf);
-            end
-
-        # if flow > 0 and unrealistic
-        else
-            container.an = FT(-Inf);
-        end
-    end
-
-    return nothing
-end
-
-
-
-
-function leaf_gas_exchange_nonopt!(
-            node::SPACSimple{FT},
-            photo_set::AbstractPhotoModelParaSet{FT},
-            flow::FT
-) where {FT<:AbstractFloat}
-    # unpack the data
-    @unpack frac_sh, frac_sl, par_sh, par_sl, rad_sh,
-            rad_sl = node.container2L;
-
-    # calculate mean par and rad per leaf area, then gas exchange rate
-    par_mean = par_sl * frac_sl + par_sh * frac_sh;
-    rad_mean = rad_sl * frac_sl + rad_sh * frac_sh;
-    leaf_gas_exchange_nonopt!(node, photo_set, flow, par_mean, rad_mean,
-                              node.laba, node.container1L);
-
-    node.containerOP = (node.ec - flow) * (node.container1L).an;
-
-    return nothing
-end
-
-
-
-
-function leaf_gas_exchange_nonopt!(
-            node::SPACSimple{FT},
-            photo_set::AbstractPhotoModelParaSet{FT},
-            f_sl::FT,
-            f_sh::FT
-) where {FT<:AbstractFloat}
-    # unpack the data
-    @unpack frac_sh, frac_sl, la_sh, la_sl, par_sh, par_sl, rad_sh,
-            rad_sl = node.container2L;
-
-    # calculate gas exchangr for sunlit and shaded layers
-    leaf_gas_exchange_nonopt!(node, photo_set, f_sl, par_sl, rad_sl, la_sl,
-                              node.container2L.cont_sl);
-    leaf_gas_exchange_nonopt!(node, photo_set, f_sh, par_sh, rad_sh, la_sh,
-                              node.container2L.cont_sh);
-
-    a_sum = frac_sl * node.container2L.cont_sl.an +
-            frac_sh * node.container2L.cont_sh.an;
-    e_sum = f_sl + f_sh;
-    node.containerOP = (node.ec - e_sum) * a_sum;
-
-    return nothing
-end
-
-
-
-
-
-
-
-
-###############################################################################
-#
-# Calculate gas exchange from flow rate considering temperature dynamics
-#
-###############################################################################
-"""
-    leaf_gas_exchange!(
-                node::SPACSimple{FT},
-                photo_set::AbstractPhotoModelParaSet{FT},
-                flow::FT,
-                par::FT,
-                rad::FT,
-                la::FT,
-                container::SPACContainer1L{FT}
-    ) where {FT<:AbstractFloat}
-    leaf_gas_exchange!(
-                node::SPACSimple{FT},
-                photo_set::AbstractPhotoModelParaSet{FT},
-                flow::FT
-    ) where {FT<:AbstractFloat}
-    leaf_gas_exchange!(
-                node::SPACSimple{FT},
-                photo_set::AbstractPhotoModelParaSet{FT},
-                f_sl::FT,
-                f_sh::FT
-    ) where {FT<:AbstractFloat}
-
-Simulate leaf level gas exchange and fill it into the `container` for 1-layer
-    or 2-layer canopy, given
-- `node` [`SPACSimple`] type struct
-- `photo_set` [`AbstractPhotoModelParaSet`] type struct
-- `flow` Flow rate per basal area into the leaves (e.g., for sunlit leaves)
-- `f_sl` Flow rate per basal area into the sunlit leaves
-- `f_sh` Flow rate per basal area into the shaded leaves
-- `par` Leaf-level photosynthetic active radiation
-- `rad` Leaf-level absorbed radiative energy
-- `la` Leaf area of the leaves (total or each layer)
-- `container` [`SPACContainer1L`] type container
-"""
-function leaf_gas_exchange!(
-            node::SPACSimple{FT},
-            photo_set::AbstractPhotoModelParaSet{FT},
-            flow::FT,
-            par::FT,
-            rad::FT,
-            la::FT,
-            container::SPACContainer1L{FT}
-) where {FT<:AbstractFloat}
-    # 0. unpack required variables
-    @unpack envir = node;
-    @unpack p_atm, p_H₂O = envir;
-
-    # 1. calculate leaf temperature from the flow rate
-    t_leaf = max(200, leaf_temperature(node, rad, flow));
-
-    # 2. update leaf photosynthetic variables and leaf-to-air VPD
-    node.ps.APAR = par;
-    leaf_temperature_dependence!(photo_set, node.ps, envir, t_leaf);
-    d_leaf = node.ps.p_sat - p_H₂O;
-
-    # 3. update f_vis and f_st in leaf and calculate water potentials
-    # TODO do not account for temperature effects for flow now
-    # More reasonable functions need to be added
-    # vc_temperature_effects!(node.hs.leaf, t_leaf);
-    p_leaf = end_pressure(node.hs, flow);
-
-    # 4. calculate photosynthesis
-    g_lw = flow / la / d_leaf * p_atm;
-    g_lc = max(FT(1e-6), g_lw / FT(1.6));
-    leaf_photosynthesis!(photo_set, node.ps, envir, GCO₂Mode(), g_lc);
-    container.ag = node.ps.Ag;
-    container.an = node.ps.An;
-    container.c  = node.ps.p_i;
-    container.e  = flow;
-    container.gh = g_lw;
-    container.p  = p_leaf;
-    container.t  = t_leaf;
-
-    return nothing
-end
-
-
-
-
-function leaf_gas_exchange!(
-            node::SPACSimple{FT},
-            photo_set::AbstractPhotoModelParaSet{FT},
-            flow::FT
-) where {FT<:AbstractFloat}
-    # unpack the data
-    @unpack container2L, laba = node;
-    @unpack frac_sh, frac_sl, par_sh, par_sl, rad_sh, rad_sl = container2L;
-
-    # calculate mean par and rad per leaf area, then gas exchange rate
-    par_mean = par_sl * frac_sl + par_sh * frac_sh;
-    rad_mean = rad_sl * frac_sl + rad_sh * frac_sh;
-    leaf_gas_exchange!(node, photo_set, flow, par_mean, rad_mean, laba,
-                       node.container1L);
-
-    return nothing
-end
-
-
-
-
-function leaf_gas_exchange!(
-            node::SPACSimple{FT},
-            photo_set::AbstractPhotoModelParaSet{FT},
-            f_sl::FT,
-            f_sh::FT
-) where {FT<:AbstractFloat}
-    # unpack the data
-    @unpack frac_sh, frac_sl, la_sh, la_sl, par_sh, par_sl, rad_sh,
-            rad_sl = node.container2L;
-
-    # calculate gas exchangr for sunlit and shaded layers
-    leaf_gas_exchange!(node, photo_set, f_sl, par_sl, rad_sl, la_sl,
-                       node.container2L.cont_sl);
-    leaf_gas_exchange!(node, photo_set, f_sh, par_sh, rad_sh, la_sh,
-                       node.container2L.cont_sh);
-
-    return nothing
-end
diff --git a/src/SoilPlantAirContinuum/bigleaf/leafallocation.jl b/src/SoilPlantAirContinuum/bigleaf/leafallocation.jl
deleted file mode 100644
index b770be01..00000000
--- a/src/SoilPlantAirContinuum/bigleaf/leafallocation.jl
+++ /dev/null
@@ -1,68 +0,0 @@
-###############################################################################
-#
-# Update leaf allocation
-#
-###############################################################################
-"""
-    leaf_allocation!(
-                node::SPACSimple{FT},
-                laba::FT
-    ) where {FT<:AbstractFloat}
-    leaf_allocation!(
-                node::SPACSimple{FT},
-                photo_set::AbstractPhotoModelParaSet{FT},
-                vmax::FT
-    ) where {FT<:AbstractFloat}
-    leaf_allocation!(
-                node::SPACSimple{FT},
-                photo_set::AbstractPhotoModelParaSet{FT},
-                laba::FT,
-                vmax::FT
-    ) where {FT<:AbstractFloat}
-
-Update leaf area and maximal carboxylation rate, given
-- `node` [`SPACSimple`] type struct
-- `photo_set` [`AbstractPhotoModelParaSet`] type struct
-- `laba` Given leaf area per basal area
-- `vmax` Given Vcmax25
-"""
-function leaf_allocation!(
-            node::SPACSimple{FT},
-            laba::FT
-) where {FT<:AbstractFloat}
-    node.laba         = laba;
-    node.hs.leaf.area = node.hs.stem.area * laba;
-    node.lai          = laba / node.gaba;
-
-    return nothing
-end
-
-
-
-
-function leaf_allocation!(
-            node::SPACSimple{FT},
-            photo_set::AbstractPhotoModelParaSet{FT},
-            vmax::FT
-) where {FT<:AbstractFloat}
-    node.ps.Vcmax25 = vmax;
-    node.ps.Jmax25  = vmax * node.vtoj;
-    node.ps.Rd25    = vmax * photo_set.VR;
-
-    return nothing
-end
-
-
-
-
-function leaf_allocation!(
-            node::SPACSimple{FT},
-            photo_set::AbstractPhotoModelParaSet{FT},
-            laba::FT,
-            vmax::FT
-) where {FT<:AbstractFloat}
-    leaf_allocation!(node, laba);
-    leaf_allocation!(node, photo_set, vmax);
-
-    return nothing
-end
diff --git a/src/SoilPlantAirContinuum/bigleaf/optimizeflow.jl b/src/SoilPlantAirContinuum/bigleaf/optimizeflow.jl
deleted file mode 100644
index d3daa971..00000000
--- a/src/SoilPlantAirContinuum/bigleaf/optimizeflow.jl
+++ /dev/null
@@ -1,48 +0,0 @@
-
-###############################################################################
-#
-# Optimize flow rates in the sunlit and shaded layers
-#
-###############################################################################
-"""
-    optimize_flows!(
-                node::SPACSimple{FT},
-                photo_set::AbstractPhotoModelParaSet{FT}
-    ) where {FT<:AbstractFloat}
-
-Optimize the flow rates in sunlit and shaded layers, given
-- `node` [`SPACSimple`] type struct
-- `photo_set` [`AbstractPhotoModelParaSet`] type struct
-"""
-function optimize_flows!(
-            node::SPACSimple{FT},
-            photo_set::AbstractPhotoModelParaSet{FT}
-) where {FT<:AbstractFloat}
-    # unpack required parameters
-    @unpack frac_sh, frac_sl = node.container2L;
-
-    # calculate the ecrit
-    node.ec = critical_flow(node.hs, node.ec);
-    ec_sl   = node.ec * frac_sl;
-    ec_sh   = node.ec * frac_sh;
-
-    # optimize the sunlit and shade layers
-    f_sl = min(ec_sl / FT(1.01), node.opt_f_sl);
-    f_sh = min(ec_sh / FT(1.01), node.opt_f_sh);
-
-    ms = ReduceStepMethodND{FT}(
-                x_mins=FT[0,0],
-                x_maxs=[ec_sl,ec_sh],
-                x_inis=[f_sl, f_sh],
-                Δ_inis=FT[0.1,0.1]);
-    st = SolutionToleranceND{FT}(FT[9e-4, 9e-4], 50);
-    @inline f(x) = (leaf_gas_exchange_nonopt!(node, photo_set, x[1], x[2]);
-                    return node.containerOP);
-    fs = find_peak(f, ms, st);
-
-    # update the optimal flow rates
-    node.opt_f_sl = fs[1];
-    node.opt_f_sh = fs[2];
-
-    return nothing
-end
diff --git a/src/SoilPlantAirContinuum/bigleaf/optimizehs.jl b/src/SoilPlantAirContinuum/bigleaf/optimizehs.jl
deleted file mode 100644
index 0bba5ca6..00000000
--- a/src/SoilPlantAirContinuum/bigleaf/optimizehs.jl
+++ /dev/null
@@ -1,57 +0,0 @@
-###############################################################################
-#
-# Optimize leaf invstment Vcmax+Jmax and Leaf area
-#
-###############################################################################
-"""
-    optimize_hs!(
-                node::SPACSimple{FT},
-                photo_set::AbstractPhotoModelParaSet{FT},
-                weather::Array{FT,2}
-    ) where {FT<:AbstractFloat}
-
-Optimize hydraulic conductance and leaf investment, given
-- `node` [`SPACSimple`] type struct
-- `photo_set` [`AbstractPhotoModelParaSet`] type struct
-- `weather` Weather profile in a growing season
-"""
-function optimize_hs!(
-            node::SPACSimple{FT},
-            photo_set::AbstractPhotoModelParaSet{FT},
-            weather::Array{FT,2}
-) where {FT<:AbstractFloat}
-    # 1. use the opt_laba and opt_vmax to initialize
-    @inline f(x) = (tmp_node = deepcopy(node);
-                    (tmp_node).hs.root.k_max = (tmp_node).containerKS[1] * x[1];
-                    (tmp_node).hs.stem.k_max = (tmp_node).containerKS[2] * x[1];
-                    (tmp_node).hs.leaf.k_sla = (tmp_node).containerKS[3] * x[1];
-                    (tmp_node).hs.root.k_element .= (tmp_node).hs.root.k_max * (tmp_node).hs.root.N;
-                    (tmp_node).hs.stem.k_element .= (tmp_node).hs.stem.k_max * (tmp_node).hs.stem.N;
-                    (tmp_node).hs.leaf.k_element .= (tmp_node).hs.leaf.k_sla * (tmp_node).hs.leaf.N;
-                    leaf_allocation!(tmp_node, photo_set, x[2], x[3]);
-                    tmp_prof = annual_profit(tmp_node, photo_set, weather);
-                    return tmp_prof);
-
-    ms = ReduceStepMethodND{FT}(
-                x_mins=FT[0.001,1,5],
-                x_maxs=FT[1e10, node.gaba*10, 200],
-                x_inis=FT[node.hs.root.k_max/node.containerKS[1],
-                          node.opt_laba,
-                          node.opt_vmax],
-                Δ_inis=FT[0.1,100,10]);
-    st = SolutionToleranceND{FT}(FT[0.0009, 0.9, 0.09], 50);
-    klv = find_peak(f, ms, st);
-
-    # 2. update the opt_laba and opt_vmax to node
-    node.hs.root.k_max = node.containerKS[1] * klv[1];
-    node.hs.stem.k_max = node.containerKS[2] * klv[1];
-    node.hs.leaf.k_sla = node.containerKS[3] * klv[1];
-    node.hs.root.k_element .= node.hs.root.k_max * node.hs.root.N;
-    node.hs.stem.k_element .= node.hs.stem.k_max * node.hs.stem.N;
-    node.hs.leaf.k_element .= node.hs.leaf.k_sla * node.hs.leaf.N;
-    leaf_allocation!(node, photo_set, klv[2], klv[3]);
-    node.opt_laba = klv[2];
-    node.opt_vmax = klv[3];
-
-    return nothing
-end
diff --git a/src/SoilPlantAirContinuum/bigleaf/optimizeleaf.jl b/src/SoilPlantAirContinuum/bigleaf/optimizeleaf.jl
deleted file mode 100644
index 34bdc46a..00000000
--- a/src/SoilPlantAirContinuum/bigleaf/optimizeleaf.jl
+++ /dev/null
@@ -1,50 +0,0 @@
-###############################################################################
-#
-# Optimize leaf invstment Vcmax+Jmax and Leaf area
-#
-###############################################################################
-"""
-    optimize_leaf!(
-                node::SPACSimple{FT},
-                photo_set::AbstractPhotoModelParaSet{FT},
-                weather::Array{FT,2},
-                printing::Bool
-    ) where {FT<:AbstractFloat}
-
-Optimize leaf area (LAI within 0-20) and photosynthetic capacity (within
-    5-200), given
-- `node` [`SPACSimple`] type struct
-- `photo_set` [`AbstractPhotoModelParaSet`] type struct
-- `weather` Weather profile in a growing season
-- `printing` Optional. If true, printing progress
-"""
-function optimize_leaf!(
-            node::SPACSimple{FT},
-            photo_set::AbstractPhotoModelParaSet{FT},
-            weather::Array{FT,2},
-            printing::Bool = false
-) where {FT<:AbstractFloat}
-    # 1. use the opt_laba and opt_vmax to initialize
-    @inline f(x) = (tmp_node = deepcopy(node);
-                    leaf_allocation!(tmp_node, photo_set, x[1], x[2]);
-                    tmp_prof = annual_profit(tmp_node, photo_set, weather);
-                    if printing
-                        @info "\tLABA=$(x[1])\tVMAX=$(x[2])\tPROF=$(tmp_prof)";
-                    end;
-                    return tmp_prof);
-
-    ms = ReduceStepMethodND{FT}(
-                x_mins=FT[1,5],
-                x_maxs=FT[node.gaba*20, 200],
-                x_inis=FT[node.opt_laba, node.opt_vmax],
-                Δ_inis=FT[100,10]);
-    st = SolutionToleranceND{FT}(FT[0.9, 0.09], 50);
-    lv = find_peak(f, ms, st);
-
-    # 2. update the opt_laba and opt_vmax to node
-    leaf_allocation!(node, photo_set, lv[1], lv[2]);
-    node.opt_laba = lv[1];
-    node.opt_vmax = lv[2];
-
-    return nothing
-end
diff --git a/src/SoilPlantAirContinuum/bigleaf/partition.jl b/src/SoilPlantAirContinuum/bigleaf/partition.jl
deleted file mode 100644
index 903cae92..00000000
--- a/src/SoilPlantAirContinuum/bigleaf/partition.jl
+++ /dev/null
@@ -1,42 +0,0 @@
-###############################################################################
-#
-# Big leaf canopy model partition
-#
-###############################################################################
-"""
-    big_leaf_partition!(
-                node::SPACSimple{FT},
-                zenith::FT,
-                r_all::FT
-    ) where {FT <:AbstractFloat}
-
-Partition the big-leaf canopy into sunlit and shaded layers, given
-- `partition` Container for partition
-- `zenith` Zenith angle in degree
-- `r_all` Total radiation in `[W m⁻²]`
-"""
-function big_leaf_partition!(
-            node::SPACSimple{FT},
-            zenith::FT,
-            r_all::FT
-) where {FT <:AbstractFloat}
-    # unpack values
-    @unpack laba, lai = node;
-
-    # 1. use big_leaf_partition function from CanopyLayers module
-    ratio, q_slm, q_shm, e_sl, e_sh = big_leaf_partition(lai, zenith, r_all);
-
-    # 2. update the information
-    node.container2L.frac_sl = ratio;
-    node.container2L.frac_sh = 1 - ratio;
-    node.container2L.la_sl   = laba * ratio;
-    node.container2L.la_sh   = laba * (1 - ratio);
-    node.container2L.lai_sl  = lai * ratio;
-    node.container2L.lai_sh  = lai * (1 - ratio);
-    node.container2L.par_sl  = q_slm;
-    node.container2L.par_sh  = q_shm;
-    node.container2L.rad_sl  = e_sl;
-    node.container2L.rad_sh  = e_sh;
-
-    return nothing
-end
diff --git a/src/SoilPlantAirContinuum/bigleaf/temperature.jl b/src/SoilPlantAirContinuum/bigleaf/temperature.jl
deleted file mode 100644
index cdea44ff..00000000
--- a/src/SoilPlantAirContinuum/bigleaf/temperature.jl
+++ /dev/null
@@ -1,192 +0,0 @@
-###############################################################################
-#
-# Radiative conductance
-#
-###############################################################################
-"""
-    radiative_conductance(T::FT) where {FT<:AbstractFloat}
-
-Return the radiative conductance of leaf, given
-- `T` leaf temperature
-"""
-function radiative_conductance(
-            T::FT
-) where {FT<:AbstractFloat}
-    _A0::FT = 0.1579;
-    _A1::FT = 0.0017;
-    _A2::FT = 7.17E-6;
-    _T ::FT = T - T₀(FT);
-
-    return _A0 + _A1*T + _A2*T^2
-end
-
-
-
-
-
-
-
-
-###############################################################################
-#
-# Black body energy emittance
-#
-###############################################################################
-"""
-    black_body_emittance(T::FT) where {FT<:AbstractFloat}
-
-Return the energy been radiated out, given
-- `T` leaf temperature
-"""
-function black_body_emittance(
-            T::FT
-) where {FT<:AbstractFloat}
-    return K_STEFAN(FT) * T^4
-end
-
-
-
-
-
-
-
-
-###############################################################################
-#
-# Leaf boundary layer conductance
-#
-###############################################################################
-"""
-    boundary_layer_conductance(wind::FT, width::FT) where {FT<:AbstractFloat}
-
-Return the boundary layer conductance, given
-- `wind` Wind speed
-- `width` Leaf width
-"""
-function boundary_layer_conductance(
-            wind::FT,
-            width::FT
-) where {FT<:AbstractFloat}
-    _A::FT = FT(1.4 * 0.135)
-    _B::FT = FT(0.72)
-
-    return _A * sqrt( wind / (_B*width) )
-end
-
-
-
-
-
-
-
-
-###############################################################################
-#
-# Leaf temperature
-#
-###############################################################################
-"""
-    leaf_temperature(
-                node::SPACSimple{FT},
-                rad::FT,
-                e_rad::FT,
-                epla::FT
-    ) where {FT<:AbstractFloat}
-    leaf_temperature(
-                node::SPACSimple{FT},
-                rad::FT,
-                flow::FT
-    ) where {FT<:AbstractFloat}
-
-Return leaf temperature, given
-- `node` [`SPACSimple`](@ref) type struct
-- `rad` Absorbed solar radiation per leaf area
-- `e_rad` Emitted absorbed radiation per leaf area
-- `epla` Flow rate per leaf area
-- `flow` Total flow rate per basal area
-"""
-function leaf_temperature(
-            node::SPACSimple{FT},
-            rad::FT,
-            e_rad::FT,
-            epla::FT
-) where {FT<:AbstractFloat}
-    @unpack t_air,wind = node.envir;
-
-    lambda = latent_heat_vapor(t_air) * M_H₂O(FT);
-    Gr     = radiative_conductance(t_air);
-    GHa    = boundary_layer_conductance(wind, node.width);
-    e_lat  = lambda * epla;
-
-    t_leaf = t_air + (rad-e_rad-e_lat) / (FT(29.3)*(Gr+GHa)) / 2;
-
-    return t_leaf
-end
-
-
-
-
-function leaf_temperature(
-            node::SPACSimple{FT},
-            rad::FT,
-            flow::FT
-) where {FT<:AbstractFloat}
-    lai = node.laba / node.gaba;
-
-    e_rad = FT(0.97) * black_body_emittance(node.envir.t_air) / max(1, lai);
-    epla  = flow / node.laba;
-
-    return leaf_temperature(node, rad, e_rad, epla)
-end
-
-
-
-
-"""
-    leaf_temperature_sunlit(
-                node::SPACSimple{FT},
-                rad::FT,
-                f_sl::FT
-    ) where {FT<:AbstractFloat}
-
-Return leaf temperature, given
-- `node` [`SPACSimple`](@ref) type struct
-- `rad` Absorbed solar radiation per leaf area
-- `f_sl` Total flow rate per basal area into sunlit leaves
-"""
-function leaf_temperature_sunlit(
-            node::SPACSimple{FT},
-            rad::FT,
-            f_sl::FT
-) where {FT<:AbstractFloat}
-    e_rad  = FT(0.97) * black_body_emittance(node.envir.t_air) /
-             max(1, (node.container2L).lai_sl);
-    epla   = f_sl / (node.container2L).la_sl;
-
-    return leaf_temperature(node, rad, e_rad, epla)
-end
-
-
-
-
-"""
-    leaf_temperature_shaded(
-                node::SPACSimple{FT},
-                rad::FT,
-                f_sh::FT
-    ) where {FT<:AbstractFloat}
-
-Return leaf temperature, given
-- `node` [`SPACSimple`](@ref) type struct
-- `rad` Absorbed solar radiation per leaf area
-- `f_sh` Total flow rate per basal area into shaded leaves
-"""
-function leaf_temperature_shaded(
-            node::SPACSimple{FT},
-            rad::FT,
-            f_sh::FT
-) where {FT<:AbstractFloat}
-    epla = f_sh / (node.container2L).la_sh;
-
-    return leaf_temperature(node, rad, FT(0), epla)
-end
diff --git a/src/SoilPlantAirContinuum/bigleaf/varytrait.jl b/src/SoilPlantAirContinuum/bigleaf/varytrait.jl
deleted file mode 100644
index 21ef7249..00000000
--- a/src/SoilPlantAirContinuum/bigleaf/varytrait.jl
+++ /dev/null
@@ -1,76 +0,0 @@
-###############################################################################
-#
-# Vary the traits in the SPACSimple struct
-#
-###############################################################################
-"""
-    vary_spac!(node::SPACSimple{FT},
-               weat_years::DataFrame,
-               factor_to_vary::String,
-               ratio_to_vary::FT
-    ) where {FT<:AbstractFloat}
-
-Generalized function to vary the SoilPlantAirContinuum to run sensitivity
-    analysis, given
-- `node` SPACSimple type struct
-- `weat_years` Weather data
-- `factor_to_vary` Which parameter to vary
-- `ratio_to_vary` How much to vary
-"""
-function vary_spac!(
-            node::SPACSimple{FT},
-            weat_years::DataFrame,
-            factor_to_vary::String,
-            ratio_to_vary::FT
-) where {FT<:AbstractFloat}
-    # choose which parameter(s) to vary
-    if factor_to_vary=="wb"
-        (node.hs.root.vc).b *= ratio_to_vary;
-        (node.hs.stem.vc).b *= ratio_to_vary;
-        (node.hs.leaf.vc).b *= ratio_to_vary;
-    elseif factor_to_vary=="wc"
-        (node.hs.root.vc).c *= ratio_to_vary;
-        (node.hs.stem.vc).c *= ratio_to_vary;
-        (node.hs.leaf.vc).c *= ratio_to_vary;
-    elseif factor_to_vary=="wk"
-        node.hs.root.k_max *= ratio_to_vary;
-        node.hs.stem.k_max *= ratio_to_vary;
-        node.hs.leaf.k_sla *= ratio_to_vary;
-        node.hs.root.k_element .*= ratio_to_vary;
-        node.hs.stem.k_element .*= ratio_to_vary;
-        node.hs.leaf.k_element .*= ratio_to_vary;
-    elseif factor_to_vary=="kw"
-        node.hs.root.k_max *= ratio_to_vary;
-        node.hs.stem.k_max *= ratio_to_vary;
-        node.hs.root.k_element .*= ratio_to_vary;
-        node.hs.stem.k_element .*= ratio_to_vary;
-    elseif factor_to_vary=="kl"
-        node.hs.leaf.k_sla *= ratio_to_vary;
-        node.hs.leaf.k_element .*= ratio_to_vary;
-    elseif factor_to_vary=="cv"
-        node.c_vmax *= ratio_to_vary;
-    elseif factor_to_vary=="cc"
-        node.c_cons *= ratio_to_vary;
-    elseif factor_to_vary=="gm"
-        node.g_max *= ratio_to_vary;
-    elseif factor_to_vary=="ga"
-        node.gaba *= ratio_to_vary;
-        node.lai  /= ratio_to_vary;
-    elseif factor_to_vary=="sd"
-        node.h_soil *= ratio_to_vary;
-        node.hs.root.p_gravity .*= ratio_to_vary;
-    elseif factor_to_vary=="ca"
-        (weat_years).CO2 *= ratio_to_vary;
-    elseif factor_to_vary=="rh"
-        (weat_years).D *= ratio_to_vary;
-    elseif factor_to_vary=="ta"
-        _multip1 = saturation_vapor_pressure.((weat_years).Tair .+ FT(273.15));
-        (weat_years).Tair .+= ratio_to_vary;
-        _multip2 = saturation_vapor_pressure.((weat_years).Tair .+ FT(273.15));
-        (weat_years).D    .*= _multip2 ./ _multip1;
-    else
-        @warn "Invalid parameter provided, nothing has been changed";
-    end
-
-    return nothing
-end
diff --git a/src/SoilPlantAirContinuum/layers/initializert.jl b/src/SoilPlantAirContinuum/layers/initializert.jl
index 94691a89..3d98c960 100755
--- a/src/SoilPlantAirContinuum/layers/initializert.jl
+++ b/src/SoilPlantAirContinuum/layers/initializert.jl
@@ -11,12 +11,12 @@ Initialize the RT parameters for a given
 """
 function initialize_spac_canopy!(node::SPACMono{FT}) where {FT<:AbstractFloat}
     # 0.1 create variables required
-    @unpack angles, envirs, in_rad, leaves_rt, n_canopy, plant_ps, photo_set, rt_con, soil_opt, wl_set = node;
+    (; angles, envirs, in_rad, leaves_rt, n_canopy, plant_ps, photo_set, rt_con, soil_opt, wl_set) = node;
     canopy_rt = node.canopy_rt;
     can_opt = node.can_opt;
     can_rad = node.can_rad;
     plant_hs = node.plant_hs;
-    fraction_sl::Array{FT,1} = repeat(canopy_rt.lidf, outer=[canopy_rt.nAzi]) / length(canopy_rt.lazitab);
+    fraction_sl::Vector{FT} = repeat(canopy_rt.lidf, outer=[canopy_rt.nAzi]) / length(canopy_rt.lazitab);
     n_sl = length(canopy_rt.lidf) * length(canopy_rt.lazitab);
 
     # fluspect the canopy layers
@@ -106,6 +106,23 @@ end
 
 
 
+"""
+    update_Kf!(node::SPACMono{FT}, Kf::FT) where {FT<:AbstractFloat}
+
+Update Kf and PSII_max
+"""
+function update_Kf!(node::SPACMono{FT}, Kf::FT) where {FT<:AbstractFloat}
+    for _iPS in node.plant_ps
+        _iPS.ps.Kf = Kf;
+        _iPS.ps.maxPSII = _iPS.ps.Kp_max / (_iPS.ps.Kp_max + _iPS.ps.Kf + _iPS.ps.Kd);
+    end;
+
+    return nothing
+end
+
+
+
+
 """
     update_Kmax!(node::SPACMono{FT}, kmax::FT) where {FT<:AbstractFloat}
 
@@ -411,6 +428,7 @@ Prescribe environmental conditions, given
 function prescribe_air!(spac::SPACMono{FT}, co2::FT, p_atm::FT, t_air::FT, vpd::FT, wind::FT) where {FT<:AbstractFloat}
     for _i_can in 1:spac.n_canopy
         _iEN = spac.envirs[_i_can];
+        _iPS = spac.plant_ps[_i_can];
 
         # update environmental conditions
         _iEN.t_air = t_air;
@@ -422,6 +440,10 @@ function prescribe_air!(spac::SPACMono{FT}, co2::FT, p_atm::FT, t_air::FT, vpd::
         _iEN.p_H₂O = _iEN.p_sat - _iEN.vpd;
         _iEN.RH    = _iEN.p_H₂O / _iEN.p_sat;
         _iEN.wind  = wind;
+
+        # update leaf boundary layer conductance for photosynthesis (no energy balance in CliMA Land v0.1)
+        _iPS.g_bh .= boundary_layer_conductance(wind, _iPS.width);
+        _iPS.g_bc .= _iPS.g_bh / FT(1.35);
     end;
 
     return nothing
diff --git a/src/SoilPlantAirContinuum/layers/layer_fluxes.jl b/src/SoilPlantAirContinuum/layers/layer_fluxes.jl
index 282a3630..f8e2a0ec 100644
--- a/src/SoilPlantAirContinuum/layers/layer_fluxes.jl
+++ b/src/SoilPlantAirContinuum/layers/layer_fluxes.jl
@@ -15,13 +15,9 @@ Run carbon, water, energy, and SIF fluxes for all canopy layers, given
 - `node` [`SPACMono`](@ref) type struct
 - `updating` If true, update cavitation history
 """
-function layer_fluxes!(
-            node::SPACMono{FT};
-            updating::Bool = false
-) where {FT<:AbstractFloat}
+function layer_fluxes!(node::SPACMono{FT}; updating::Bool = false) where {FT<:AbstractFloat}
     # 0.1 unpack data
-    @unpack angles, envirs, f_SL, ga, in_rad, leaves_rt, n_canopy, photo_set,
-            plant_ps, rt_con, rt_dim, soil_opt, stomata_model, wl_set = node;
+    (; angles, envirs, f_SL, ga, in_rad, leaves_rt, n_canopy, photo_set, plant_ps, rt_con, rt_dim, soil_opt, stomata_model, wl_set) = node;
     canopy_rt = node.canopy_rt;
     can_rad = node.can_rad;
     can_opt = node.can_opt;
@@ -31,8 +27,7 @@ function layer_fluxes!(
     canopy_geometry!(canopy_rt, angles, can_opt, rt_con);
     canopy_matrices!(leaves_rt, can_opt);
     short_wave!(canopy_rt, can_opt, can_rad, in_rad, soil_opt, rt_con);
-    canopy_fluxes!(canopy_rt, can_opt, can_rad, in_rad, soil_opt, leaves_rt,
-                   wl_set, rt_con);
+    canopy_fluxes!(canopy_rt, can_opt, can_rad, in_rad, soil_opt, leaves_rt, wl_set, rt_con);
 
     #
     f_H₂O = 0;
@@ -78,8 +73,7 @@ function layer_fluxes!(
                 #
                 prognostic_gsw!(iPS, iEN, stomata_model, FT(1), FT(120));
             else
-                prognostic_gsw!(photo_set, iPS, iHS, iEN, stomata_model,
-                                FT(120));
+                prognostic_gsw!(photo_set, iPS, iHS, iEN, stomata_model, FT(120));
             end
 
             # update flow and pressure profile (except for history)
@@ -89,8 +83,7 @@ function layer_fluxes!(
                 iEN = envirs[i_can];
                 iLF = plant_hs.leaves[i_can];
                 iPS = plant_ps[i_can];
-                iLF.flow = sum(iPS.g_lw .* iPS.LAIx) *
-                           (iPS.p_sat - iEN.p_H₂O) / iEN.p_atm;
+                iLF.flow = sum(iPS.g_lw .* iPS.LAIx) * (iPS.p_sat - iEN.p_H₂O) / iEN.p_atm;
             end
             flow_profile!(plant_hs);
             pressure_profile!(plant_hs, SteadyStateMode(); update=false);
@@ -115,22 +108,19 @@ function layer_fluxes!(
         end
 
         # update the fluorescence quantum yield from leaf level calculation
-        can_rad.ϕ_sun[:,:,iRT] .= reshape(view(iPS.φs,1:nSL), canopy_rt.nIncl,
-                                          canopy_rt.nAzi);
+        can_rad.ϕ_sun[:,:,iRT] .= reshape(view(iPS.φs,1:nSL), canopy_rt.nIncl, canopy_rt.nAzi);
         can_rad.ϕ_shade[iRT] = iPS.φs[end];
 
         # update the flow rates
         for iLF in 1:(nSL+1)
             f_GPP += iPS.Ag[iLF] * iPS.LAIx[iLF] * iPS.LA;
             f_NPP += iPS.An[iLF] * iPS.LAIx[iLF] * iPS.LA;
-            f_H₂O += iPS.g_lw[iLF] * (iPS.p_sat - iEN.p_H₂O) / iEN.p_atm *
-                     iPS.LAIx[iLF] * iPS.LA;
+            f_H₂O += iPS.g_lw[iLF] * (iPS.p_sat - iEN.p_H₂O) / iEN.p_atm * iPS.LAIx[iLF] * iPS.LA;
         end
     end
 
     # do SIF simulation
-    SIF_fluxes!(leaves_rt, can_opt, can_rad, canopy_rt, soil_opt, wl_set,
-                rt_con, rt_dim);
+    SIF_fluxes!(leaves_rt, can_opt, can_rad, canopy_rt, soil_opt, wl_set, rt_con, rt_dim);
 
     # update flow profile and pressure history along the tree
     if updating
@@ -138,8 +128,7 @@ function layer_fluxes!(
             iEN = envirs[i_can];
             iLF = plant_hs.leaves[i_can];
             iPS = plant_ps[i_can];
-            iLF.flow = sum(iPS.g_lw .* iPS.LAIx) *
-                       (iPS.p_sat - iEN.p_H₂O) / iEN.p_atm;
+            iLF.flow = sum(iPS.g_lw .* iPS.LAIx) * (iPS.p_sat - iEN.p_H₂O) / iEN.p_atm;
         end
         flow_profile!(plant_hs);
         pressure_profile!(plant_hs, SteadyStateMode(); update=true);
@@ -160,25 +149,16 @@ end
 
 
 """
-    layer_fluxes!(
-                node::SPACMono{FT},
-                Δt::FT;
-                updating::Bool = false
-    ) where {FT<:AbstractFloat}
+    layer_fluxes!(node::SPACMono{FT}, Δt::FT; updating::Bool = false) where {FT<:AbstractFloat}
 
 Run carbon, water, energy, and SIF fluxes for all canopy layers, given
 - `node` [`SPACMono`](@ref) type struct
 - `Δt` Time step to forward in time
 - `updating` If true, update cavitation history
 """
-function layer_fluxes!(
-            node::SPACMono{FT},
-            Δt::FT;
-            updating::Bool = false
-) where {FT<:AbstractFloat}
+function layer_fluxes!(node::SPACMono{FT}, Δt::FT; updating::Bool = false) where {FT<:AbstractFloat}
     # 0.1 unpack data
-    @unpack angles, envirs, f_SL, ga, in_rad, leaves_rt, n_canopy, photo_set,
-            plant_ps, rt_con, rt_dim, soil_opt, stomata_model, wl_set = node;
+    (; angles, envirs, f_SL, ga, in_rad, leaves_rt, n_canopy, photo_set, plant_ps, rt_con, rt_dim, soil_opt, stomata_model, wl_set) = node;
     canopy_rt = node.canopy_rt;
     can_rad = node.can_rad;
     can_opt = node.can_opt;
@@ -188,8 +168,7 @@ function layer_fluxes!(
     canopy_geometry!(canopy_rt, angles, can_opt, rt_con);
     canopy_matrices!(leaves_rt, can_opt);
     short_wave!(canopy_rt, can_opt, can_rad, in_rad, soil_opt, rt_con);
-    canopy_fluxes!(canopy_rt, can_opt, can_rad, in_rad, soil_opt, leaves_rt,
-                   wl_set, rt_con);
+    canopy_fluxes!(canopy_rt, can_opt, can_rad, in_rad, soil_opt, leaves_rt, wl_set, rt_con);
 
     #
     f_H₂O = 0;
@@ -240,8 +219,7 @@ function layer_fluxes!(
             iEN = envirs[i_can];
             iLF = plant_hs.leaves[i_can];
             iPS = plant_ps[i_can];
-            iLF.flow = sum(iPS.g_lw .* iPS.LAIx) *
-                       (iPS.p_sat - iEN.p_H₂O) / iEN.p_atm;
+            iLF.flow = sum(iPS.g_lw .* iPS.LAIx) * (iPS.p_sat - iEN.p_H₂O) / iEN.p_atm;
         end
         flow_profile!(plant_hs);
         pressure_profile!(plant_hs, SteadyStateMode(); update=false);
@@ -255,22 +233,19 @@ function layer_fluxes!(
         end;
 
         # update the fluorescence quantum yield from leaf level calculation
-        can_rad.ϕ_sun[:,:,iRT] .= reshape(view(iPS.φs,1:nSL), canopy_rt.nIncl,
-                                          canopy_rt.nAzi);
+        can_rad.ϕ_sun[:,:,iRT] .= reshape(view(iPS.φs,1:nSL), canopy_rt.nIncl, canopy_rt.nAzi);
         can_rad.ϕ_shade[iRT] = iPS.φs[end];
 
         # update the flow rates
         for iLF in 1:(nSL+1)
             f_GPP += iPS.Ag[iLF] * iPS.LAIx[iLF] * iPS.LA;
             f_NPP += iPS.An[iLF] * iPS.LAIx[iLF] * iPS.LA;
-            f_H₂O += iPS.g_lw[iLF] * (iPS.p_sat - iEN.p_H₂O) / iEN.p_atm *
-                     iPS.LAIx[iLF] * iPS.LA;
+            f_H₂O += iPS.g_lw[iLF] * (iPS.p_sat - iEN.p_H₂O) / iEN.p_atm * iPS.LAIx[iLF] * iPS.LA;
         end
     end
 
     # do SIF simulation
-    SIF_fluxes!(leaves_rt, can_opt, can_rad, canopy_rt, soil_opt, wl_set,
-                rt_con, rt_dim);
+    SIF_fluxes!(leaves_rt, can_opt, can_rad, canopy_rt, soil_opt, wl_set, rt_con, rt_dim);
 
     # update flow profile and pressure history along the tree
     if updating
@@ -278,8 +253,7 @@ function layer_fluxes!(
             iEN = envirs[i_can];
             iLF = plant_hs.leaves[i_can];
             iPS = plant_ps[i_can];
-            iLF.flow = sum(iPS.g_lw .* iPS.LAIx) *
-                       (iPS.p_sat - iEN.p_H₂O) / iEN.p_atm;
+            iLF.flow = sum(iPS.g_lw .* iPS.LAIx) * (iPS.p_sat - iEN.p_H₂O) / iEN.p_atm;
         end
         flow_profile!(plant_hs);
         pressure_profile!(plant_hs, SteadyStateMode(); update=true);
diff --git a/src/SoilPlantAirContinuum/layers/measures.jl b/src/SoilPlantAirContinuum/layers/measures.jl
deleted file mode 100644
index e2edc1ad..00000000
--- a/src/SoilPlantAirContinuum/layers/measures.jl
+++ /dev/null
@@ -1,67 +0,0 @@
-"""
-    GPP(spac::SPACMono{FT}) where {FT<:AbstractFloat}
-
-Return the GPP of the SPAC per ground area
-"""
-function GPP(spac::SPACMono{FT}) where {FT<:AbstractFloat}
-    _gpp::FT = 0;
-
-    for _i_can in 1:spac.n_canopy
-        _iPS = spac.plant_ps[_i_can];
-        _gpp += numerical∫(_iPS.Ag, _iPS.LAIx) * _iPS.LA;
-    end;
-
-    return _gpp / spac.ga
-end
-
-
-"""
-    CNPP(spac::SPACMono{FT}) where {FT<:AbstractFloat}
-
-Return the canopy NPP of the SPAC per ground area
-"""
-function CNPP(spac::SPACMono{FT}) where {FT<:AbstractFloat}
-    _cnpp::FT = 0;
-
-    for _i_can in 1:spac.n_canopy
-        _iPS = spac.plant_ps[_i_can];
-        _cnpp += numerical∫(_iPS.An, _iPS.LAIx) * _iPS.LA;
-    end;
-
-    return _cnpp / spac.ga
-end
-
-
-"""
-    T_VEG(spac::SPACMono{FT}) where {FT<:AbstractFloat}
-
-Return the transpiration of the SPAC per ground area
-"""
-function T_VEG(spac::SPACMono{FT}) where {FT<:AbstractFloat}
-    _t_veg::FT = 0;
-
-    for _i_can in 1:spac.n_canopy
-        _iEN = spac.envirs[_i_can];
-        _iPS = spac.plant_ps[_i_can];
-        _t_veg += numerical∫(_iPS.g_lw, _iPS.LAIx) * (_iPS.p_sat - _iEN.p_H₂O) / _iEN.p_atm * _iPS.LA;
-    end;
-
-    return _t_veg / spac.ga
-end
-
-
-"""
-    PPAR(spac::SPACMono{FT}) where {FT<:AbstractFloat}
-
-Return the cumulative PPAR of the SPAC per ground area
-"""
-function PPAR(spac::SPACMono{FT}) where {FT<:AbstractFloat}
-    _ppar::FT = 0;
-
-    for _i_can in 1:spac.n_canopy
-        _iPS = spac.plant_ps[_i_can];
-        _ppar += numerical∫(_iPS.APAR, _iPS.LAIx) * FT(1e-6) * spac.canopy_rt.LAI / spac.canopy_rt.nLayer;
-    end;
-
-    return _ppar
-end
diff --git a/src/SoilPlantAirContinuum/layers/test_diurnal.jl b/src/SoilPlantAirContinuum/layers/test_diurnal.jl
index f53e8949..b43b15e1 100644
--- a/src/SoilPlantAirContinuum/layers/test_diurnal.jl
+++ b/src/SoilPlantAirContinuum/layers/test_diurnal.jl
@@ -22,9 +22,9 @@ function test_diurnal(
             Δt::FT=FT(10)
 ) where {FT<:AbstractFloat}
     # 0.1 create variables required
-    @unpack n_canopy, wl_set = node;
+    (; n_canopy, wl_set) = node;
     canopy_rt = node.canopy_rt;
-    fraction_sl::Array{FT,1} = repeat(canopy_rt.lidf, outer=[ length(canopy_rt.lazitab) ]) / length(canopy_rt.lazitab);
+    fraction_sl::Vector{FT} = repeat(canopy_rt.lidf, outer=[ length(canopy_rt.lazitab) ]) / length(canopy_rt.lazitab);
     n_sl = length(canopy_rt.lidf) * length(canopy_rt.lazitab);
 
 
diff --git a/src/SoilPlantAirContinuum/layers/test_soil.jl b/src/SoilPlantAirContinuum/layers/test_soil.jl
index 2ba06f94..858197e1 100644
--- a/src/SoilPlantAirContinuum/layers/test_soil.jl
+++ b/src/SoilPlantAirContinuum/layers/test_soil.jl
@@ -5,11 +5,11 @@
 #=
 function test_soil_from_psoil(
             node::SPACMono{FT},
-            psoils::Array{FT,1},
+            psoils::Vector{FT},
             Δt::FT=FT(10)
 ) where {FT<:AbstractFloat}
     # unpack the values
-    @unpack n_canopy = node;
+    (; n_canopy) = node;
     n_sl = node.canopy_rt.nAzi * node.canopy_rt.nIncl;
 
     # update the soil water contents and potential in each layer
@@ -64,11 +64,11 @@ end
 
 function test_soil_from_swc(
             node::SPACMono{FT},
-            swcs::Array{FT,1},
+            swcs::Vector{FT},
             Δt::FT=FT(10)
 ) where {FT<:AbstractFloat}
     # unpack the values
-    @unpack n_canopy = node;
+    (; n_canopy) = node;
     n_sl = node.canopy_rt.nAzi * node.canopy_rt.nIncl;
 
     # update the soil water contents and potential in each layer
@@ -128,7 +128,7 @@ end
 
 function test_soil_from_psoil!(
             node::SPACMono{FT},
-            psoils::Array{FT,1},
+            psoils::Vector{FT},
             e_sum::FT
 ) where {FT<:AbstractFloat}
     # update the soil water contents and potential in each layer
@@ -151,7 +151,7 @@ end
 
 function test_soil_from_swc!(
             node::SPACMono{FT},
-            swcs::Array{FT,1},
+            swcs::Vector{FT},
             e_sum::FT
 ) where {FT<:AbstractFloat}
     # update the soil water contents and potential in each layer
diff --git a/src/SoilPlantAirContinuum/layers/windspeed.jl b/src/SoilPlantAirContinuum/layers/windspeed.jl
index 94164c9c..e924b6f1 100644
--- a/src/SoilPlantAirContinuum/layers/windspeed.jl
+++ b/src/SoilPlantAirContinuum/layers/windspeed.jl
@@ -113,7 +113,7 @@ function wind_speed!(
             spac::SPACMono{FT},
             us::FT
 ) where {FT<:AbstractFloat}
-    @unpack air_bounds, n_canopy, wind_d, wind_z0, wind_zs = spac;
+    (; air_bounds, n_canopy, wind_d, wind_z0, wind_zs) = spac;
     spac.winds .= wind_speed.(us, wind_z0, wind_d, wind_zs);
 
     return nothing
@@ -127,7 +127,7 @@ function wind_speed!(
             wr::FT,
             zr::FT
 ) where {FT<:AbstractFloat}
-    @unpack air_bounds, n_canopy, wind_d, wind_z0, wind_zs = spac;
+    (; air_bounds, n_canopy, wind_d, wind_z0, wind_zs) = spac;
     spac.winds .= wind_speed.(wr, zr, wind_z0, wind_d, wind_zs);
 
     return nothing
diff --git a/src/SoilPlantAirContinuum/quantities/measures.jl b/src/SoilPlantAirContinuum/quantities/measures.jl
new file mode 100644
index 00000000..451c5e3a
--- /dev/null
+++ b/src/SoilPlantAirContinuum/quantities/measures.jl
@@ -0,0 +1,32 @@
+"""
+    T_VEG(spac::SPACMono{FT}) where {FT<:AbstractFloat}
+
+Return the transpiration of the SPAC per ground area
+"""
+function T_VEG(spac::SPACMono{FT}) where {FT<:AbstractFloat}
+    t_veg::FT = 0;
+
+    for i_can in 1:spac.n_canopy
+        iEN = spac.envirs[i_can];
+        iPS = spac.plant_ps[i_can];
+        t_veg += numerical∫(iPS.g_lw, iPS.LAIx) * (iPS.p_sat - iEN.p_H₂O) / iEN.p_atm * iPS.LA;
+    end;
+
+    return t_veg / spac.ga
+end
+
+
+"""
+    PPAR(spac::SPACMono{FT}) where {FT<:AbstractFloat}
+
+Return the cumulative PPAR of the SPAC per ground area
+"""
+function PPAR(spac::SPACMono{FT}) where {FT<:AbstractFloat}
+    ppar::FT = 0;
+
+    for iPS in spac.plant_ps
+        ppar += numerical∫(iPS.APAR, iPS.LAIx) * FT(1e-6) * spac.canopy_rt.LAI / spac.canopy_rt.nLayer;
+    end;
+
+    return ppar
+end
diff --git a/src/SoilPlantAirContinuum/quantities/photosynthesis.jl b/src/SoilPlantAirContinuum/quantities/photosynthesis.jl
new file mode 100644
index 00000000..690d246b
--- /dev/null
+++ b/src/SoilPlantAirContinuum/quantities/photosynthesis.jl
@@ -0,0 +1,41 @@
+"""
+
+    A_GROSS(node::SPACMono{FT}) where {FT}
+
+Return the gross photosynthesis rate per layer, given
+- `node` [`SPACMono`](@ref) type struct
+
+"""
+A_GROSS(node::SPACMono{FT}) where {FT} = FT[iPS.Ag' * iPS.LAIx for iPS in node.plant_ps];
+
+
+"""
+    CNPP(spac::SPACMono{FT}) where {FT<:AbstractFloat}
+
+Return the canopy NPP of the SPAC per ground area
+"""
+function CNPP(spac::SPACMono{FT}) where {FT<:AbstractFloat}
+    cnpp::FT = 0;
+
+    for iPS in spac.plant_ps
+        cnpp += numerical∫(iPS.An, iPS.LAIx) * iPS.LA;
+    end;
+
+    return cnpp / spac.ga
+end;
+
+
+"""
+    GPP(spac::SPACMono{FT}) where {FT<:AbstractFloat}
+
+Return the GPP of the SPAC per ground area
+"""
+function GPP(spac::SPACMono{FT}) where {FT<:AbstractFloat}
+    gpp::FT = 0;
+
+    for iPS in spac.plant_ps
+        gpp += numerical∫(iPS.Ag, iPS.LAIx) * iPS.LA;
+    end;
+
+    return gpp / spac.ga
+end;
diff --git a/src/SoilPlantAirContinuum/simulation/annualprofit.jl b/src/SoilPlantAirContinuum/simulation/annualprofit.jl
deleted file mode 100644
index 31a7949d..00000000
--- a/src/SoilPlantAirContinuum/simulation/annualprofit.jl
+++ /dev/null
@@ -1,114 +0,0 @@
-###############################################################################
-#
-# Calculate annual profit
-#
-###############################################################################
-"""
-    annual_profit(
-                node::SPACSimple{FT},
-                photo_set::AbstractPhotoModelParaSet{FT},
-                weather::Array{FT,2}
-    ) where {FT<:AbstractFloat}
-
-Calculate the profit in the growing season so as to optimize leaf investment,
-    given
-- `node` [`SPACSimple`] type struct
-- `photo_set` [`AbstractPhotoModelParaSet`] type struct
-- `weather` Weather profile in a growing season
-"""
-function annual_profit(
-            node::SPACSimple{FT},
-            photo_set::AbstractPhotoModelParaSet{FT},
-            weather::Array{FT,2}
-) where {FT<:AbstractFloat}
-    # 0. unpack required values
-    #    make sure construction cost must be postive
-    @unpack c_cons, c_vmax, elevation, gaba, laba, latitude, vtoj = node;
-    cons = laba * (c_cons + node.ps.Vcmax25 * c_vmax);
-
-    # if cons > 0
-    if cons > 0
-        # 1. update the environmental constants based on node geographycal info
-        ratio            = atmospheric_pressure_ratio(elevation);
-        node.envir.p_atm = ratio * P_ATM(FT);
-        node.envir.p_O₂  = node.envir.p_atm * FT(0.209);
-
-        # 2. calculate the growing season canopy profit
-        day  ::FT = FT(0);
-        hour ::FT = FT(0);
-        _tair::FT = FT(0);
-        _dair::FT = FT(0);
-        p_co2::FT = FT(0);
-        r_all::FT = FT(0);
-        wind ::FT = FT(0);
-        rain ::FT = FT(0);
-        gscp ::FT = FT(0);
-        anet ::FT = FT(0);
-
-        N = size(weather)[1]
-        for i in 1:N
-            # 2.1 read and update the hourly data
-            day   = weather[i,2 ]
-            hour  = weather[i,3 ]
-            _tair = weather[i,7 ]
-            _dair = weather[i,9 ]
-            p_co2 = weather[i,10] * ratio
-            r_all = weather[i,4 ]
-            wind  = weather[i,6 ]
-            rain  = weather[i,5 ]
-
-            node.envir.t_air = _tair + T₀(FT);
-            node.envir.p_sat = saturation_vapor_pressure( node.envir.t_air );
-            node.envir.p_a   = p_co2;
-            node.envir.vpd   = _dair * 1000;
-            node.envir.p_H₂O = node.envir.p_sat - node.envir.vpd;
-            node.envir.RH    = node.envir.p_H₂O / node.envir.p_sat;
-            node.envir.wind  = wind;
-
-            # 2.2 if day time
-            zenith = zenith_angle(latitude, day, hour, FT(0));
-            if (r_all>0) & (zenith<=85)
-                # 2.2.1 update the leaf partitioning
-                big_leaf_partition!(node, zenith, r_all);
-                @unpack frac_sh, frac_sl = node.container2L;
-
-                # 2.2.2 optimize flows in each layer
-                optimize_flows!(node, photo_set);
-                leaf_gas_exchange!(node, photo_set, node.opt_f_sl, node.opt_f_sh);
-                flow = node.opt_f_sl + node.opt_f_sh;
-                anet = frac_sl * node.container2L.cont_sl.an +
-                       frac_sh * node.container2L.cont_sh.an;
-
-                # 2.2.3 update drought history
-                pressure_profile!(node.hs, node.p_soil, node.opt_f_sl,
-                                  node.opt_f_sh, frac_sl);
-
-            # 2.3 if night time
-            else
-                node.ps.T = max(200, leaf_temperature(node, r_all, FT(0)));
-                leaf_rd!(photo_set.ReT, node.ps);
-                flow = FT(0);
-                anet = -node.ps.Rd;
-            end
-
-            # 2.4 update soil moisture by converting flow to Kg per hour
-            flow /= KG_H_2_MOL_S(FT);
-            rain *= gaba * ρ_H₂O(FT) / 1000;
-            soil_moisture!(node, flow-rain);
-
-            # 2.5 add up the gscp
-            gscp += anet
-        end
-
-        # 3. scale gscp to mol per year
-        gscp *= laba * FT(1e-6) * 3600;
-
-        # 4. substract the construction costs
-        gscp -= cons;
-
-    else
-        gscp = FT(-Inf);
-    end
-
-    return gscp
-end
diff --git a/src/SoilPlantAirContinuum/simulation/annualsimulation.jl b/src/SoilPlantAirContinuum/simulation/annualsimulation.jl
deleted file mode 100644
index f89eb7f5..00000000
--- a/src/SoilPlantAirContinuum/simulation/annualsimulation.jl
+++ /dev/null
@@ -1,155 +0,0 @@
-###############################################################################
-#
-# Calculate annual profit
-#
-###############################################################################
-"""
-    annual_simulation!(
-                node::SPACSimple{FT},
-                photo_set::AbstractPhotoModelParaSet{FT},
-                weather::DataFrame,
-                output::DataFrame
-    ) where {FT<:AbstractFloat}
-
-Run annual simulation for a growing season, given
-- `node` [`SPACSimple`] type struct
-- `photo_set` [`AbstractPhotoModelParaSet`] type struct
-- `weather` Weather profile in a growing season
-- `output` The predefined output result
-"""
-function annual_simulation!(
-            node::SPACSimple{FT},
-            photo_set::AbstractPhotoModelParaSet{FT},
-            weather::DataFrame,
-            output::DataFrame
-) where {FT<:AbstractFloat}
-    # 0. unpack required values
-    @unpack elevation, gaba, laba, latitude, vtoj = node;
-
-    # 1. update the environmental constants based on the node geographycal info
-    ratio            = atmospheric_pressure_ratio(elevation);
-    node.envir.p_atm = ratio * P_ATM(FT);
-    node.envir.p_O₂  = node.envir.p_atm * FT(0.209);
-
-    # 2. calculate the growing season canopy profit
-    gscp   = FT(0);
-    for i in eachindex( (weather).Year )
-        # 2.1 read and update the hourly data
-        day  ::FT = (weather).Day[i]
-        hour ::FT = (weather).Hour[i]
-        _tair::FT = (weather).Tair[i]
-        _dair::FT = (weather).D[i]
-        p_co2::FT = (weather).CO2[i] * ratio
-        r_all::FT = (weather).Solar[i]
-        wind ::FT = (weather).Wind[i]
-        rain ::FT = (weather).Rain[i]
-
-        node.envir.t_air = _tair + T₀(FT);
-        node.envir.p_sat = saturation_vapor_pressure( node.envir.t_air );
-        node.envir.p_a   = p_co2;
-        node.envir.vpd   = _dair * 1000;
-        node.envir.p_H₂O = node.envir.p_sat - node.envir.vpd;
-        node.envir.RH    = node.envir.p_H₂O / node.envir.p_sat;
-        node.envir.wind  = wind;
-
-        # 2.2 if day time
-        zenith = zenith_angle(latitude, day, hour, FT(0));
-        if (r_all>0) & (zenith<=85)
-            # 2.2.1 update the leaf partitioning
-            big_leaf_partition!(node, zenith, r_all)
-            @unpack frac_sh, frac_sl = node.container2L;
-
-            # 2.2.2 optimize flows in each layer
-            optimize_flows!(node, photo_set);
-            leaf_gas_exchange!(node, photo_set, node.opt_f_sl, node.opt_f_sh);
-            flow = node.opt_f_sl + node.opt_f_sh;
-            anet = frac_sl * node.container2L.cont_sl.an +
-                   frac_sh * node.container2L.cont_sh.an;
-
-            # 2.2.3 update drought history
-            pressure_profile!(node.hs, node.p_soil, node.opt_f_sl,
-                              node.opt_f_sh, frac_sl);
-
-            # 2.2.4 pass values to DataFrame
-            output[i, "LAI_sl"] = (node.container2L).lai_sl
-            output[i, "PAR_sl"] = (node.container2L).par_sl
-            output[i, "RAD_sl"] = (node.container2L).rad_sl
-            output[i, "E_sl"  ] = (node.container2L).cont_sl.e
-            output[i, "P_sl"  ] = (node.container2L).cont_sl.p
-            output[i, "An_sl" ] = (node.container2L).cont_sl.an
-            output[i, "Ag_sl" ] = (node.container2L).cont_sl.ag
-            output[i, "C_sl"  ] = (node.container2L).cont_sl.c
-            output[i, "G_sl"  ] = (node.container2L).cont_sl.gh
-            output[i, "T_sl"  ] = (node.container2L).cont_sl.t
-
-            output[i, "LAI_sh"] = (node.container2L).lai_sh
-            output[i, "PAR_sh"] = (node.container2L).par_sh
-            output[i, "RAD_sh"] = (node.container2L).rad_sh
-            output[i, "E_sh"  ] = (node.container2L).cont_sh.e
-            output[i, "P_sh"  ] = (node.container2L).cont_sh.p
-            output[i, "An_sh" ] = (node.container2L).cont_sh.an
-            output[i, "Ag_sh" ] = (node.container2L).cont_sh.ag
-            output[i, "C_sh"  ] = (node.container2L).cont_sh.c
-            output[i, "G_sh"  ] = (node.container2L).cont_sh.gh
-            output[i, "T_sh"  ] = (node.container2L).cont_sh.t
-
-        # 2.3 if night time
-        else
-            # 2.3.1 calculate leaf temperature
-            tlef = max(200, leaf_temperature(node, r_all, FT(0)));
-
-            # 2.3.2 calculate the gas exchange rates
-            node.ps.T = tlef;
-            leaf_rd!(photo_set.ReT, node.ps);
-            anet = -node.ps.Rd;
-
-            # 2.3.3 update temperature effects and then leaf water potential
-            flow = FT(0);
-            # TODO more reasonable functions need to be added
-            # vc_temperature_effects!(node.hs.leaf, tlef);
-            plef = end_pressure(node.hs, flow);
-
-            # 2.3.4 pass values to DataFrame
-            output[i, "LAI_sl"] = FT(0)
-            output[i, "PAR_sl"] = FT(0)
-            output[i, "RAD_sl"] = FT(0)
-            output[i, "E_sl"  ] = FT(0)
-            output[i, "P_sl"  ] = plef
-            output[i, "An_sl" ] = anet
-            output[i, "Ag_sl" ] = FT(0)
-            output[i, "C_sl"  ] = p_co2
-            output[i, "G_sl"  ] = FT(0)
-            output[i, "T_sl"  ] = tlef
-
-            output[i, "LAI_sh"] = node.lai
-            output[i, "PAR_sh"] = FT(0)
-            output[i, "RAD_sh"] = FT(0)
-            output[i, "E_sh"  ] = FT(0)
-            output[i, "P_sh"  ] = plef
-            output[i, "An_sh" ] = anet
-            output[i, "Ag_sh" ] = FT(0)
-            output[i, "C_sh"  ] = p_co2
-            output[i, "G_sh"  ] = FT(0)
-            output[i, "T_sh"  ] = tlef
-        end
-
-        # pass more data to DataFrame
-        output[i, "T_air" ] = _tair
-        output[i, "D_air" ] = _dair
-        output[i, "Wind"  ] = wind
-        output[i, "Rain"  ] = rain
-        output[i, "Ca"    ] = p_co2
-        output[i, "SWC"   ] = node.swc
-        output[i, "P_soil"] = node.p_soil
-        output[i, "H_sun" ] = 90 - zenith
-        output[i, "A_net" ] = anet
-        output[i, "E_crit"] = node.ec
-
-        # 2.4 update soil moisture by converting flow to Kg per hour
-        flow /= KG_H_2_MOL_S(FT);
-        rain *= gaba * ρ_H₂O(FT) / 1000;
-        soil_moisture!(node, flow-rain);
-    end
-
-    return nothing
-end
diff --git a/src/SoilPlantAirContinuum/simulation/createdataframe.jl b/src/SoilPlantAirContinuum/simulation/createdataframe.jl
deleted file mode 100644
index 0d924c92..00000000
--- a/src/SoilPlantAirContinuum/simulation/createdataframe.jl
+++ /dev/null
@@ -1,59 +0,0 @@
-###############################################################################
-#
-# Create DataFrame to save simulation output
-#
-###############################################################################
-"""
-    function create_dataframe(FT, weather::DataFrame)
-
-Create a data frame to store simulation output, given
-- `FT` Floating number type
-- `weather` Weather profile in a growing season
-"""
-function create_dataframe(
-            FT,
-            weather::DataFrame
-)
-    df    = DataFrame();
-
-    # climatic info
-    df[!, "Time"  ]  = (weather).Day + (weather).Hour / FT(24);
-    df[!, "T_air" ] .= FT(0);
-    df[!, "D_air" ] .= FT(0);
-    df[!, "Wind"  ] .= FT(0);
-    df[!, "Rain"  ] .= FT(0);
-    df[!, "Ca"    ] .= FT(0);
-
-    # whole tree level
-    df[!, "SWC"   ] .= FT(0);
-    df[!, "P_soil"] .= FT(0);
-    df[!, "H_sun" ] .= FT(0);
-    df[!, "A_net" ] .= FT(0);
-    df[!, "E_crit"] .= FT(0);
-
-    # sunlit layers
-    df[!, "LAI_sl"] .= FT(0);
-    df[!, "PAR_sl"] .= FT(0);
-    df[!, "RAD_sl"] .= FT(0);
-    df[!, "E_sl"  ] .= FT(0);
-    df[!, "P_sl"  ] .= FT(0);
-    df[!, "An_sl" ] .= FT(0);
-    df[!, "Ag_sl" ] .= FT(0);
-    df[!, "C_sl"  ] .= FT(0);
-    df[!, "G_sl"  ] .= FT(0);
-    df[!, "T_sl"  ] .= FT(0);
-
-    # shaded layers
-    df[!, "LAI_sh"] .= FT(0);
-    df[!, "PAR_sh"] .= FT(0);
-    df[!, "RAD_sh"] .= FT(0);
-    df[!, "E_sh"  ] .= FT(0);
-    df[!, "P_sh"  ] .= FT(0);
-    df[!, "An_sh" ] .= FT(0);
-    df[!, "Ag_sh" ] .= FT(0);
-    df[!, "C_sh"  ] .= FT(0);
-    df[!, "G_sh"  ] .= FT(0);
-    df[!, "T_sh"  ] .= FT(0);
-
-    return df
-end
diff --git a/src/SoilPlantAirContinuum/soil/moisture.jl b/src/SoilPlantAirContinuum/soil/moisture.jl
deleted file mode 100644
index cda32856..00000000
--- a/src/SoilPlantAirContinuum/soil/moisture.jl
+++ /dev/null
@@ -1,102 +0,0 @@
-###############################################################################
-#
-# Update soil from water content or pressure
-#
-###############################################################################
-"""
-    soil_moisture_swc!(node::SPACSimple{FT}, swc::FT) where {FT<:AbstractFloat}
-
-Update soil moisture and soil matrix potential, given
-- `node` [`SPACSimple`](@ref) type struct
-- `swc` Given soil water content
-"""
-function soil_moisture_swc!(
-            node::SPACSimple{FT},
-            swc::FT
-) where {FT<:AbstractFloat}
-    if swc < node.mswc
-        node.swc = swc;
-    else
-        node.swc = node.mswc;
-    end
-
-    node.p_soil = soil_p_25_swc(node.hs.root.sh, node.swc) * node.hs.root.f_st;
-
-    return nothing
-end
-
-
-
-
-"""
-    soil_moisture_p!(node::SPACSimple{FT}, p::FT) where {FT<:AbstractFloat}
-
-Update soil moisture and soil matrix potential, given
-- `node` [`SPACSimple`](@ref) type struct
-- `p` Given soil maxtrix potential
-"""
-function soil_moisture_p!(
-            node::SPACSimple{FT},
-            p::FT
-) where {FT<:AbstractFloat}
-    node.p_soil = p;
-    p_25        = p / node.hs.root.f_st;
-    node.swc    = soil_swc(node.hs.root.sh, p_25);
-
-    return nothing
-end
-
-
-
-
-"""
-    soil_moisture_p25!(
-                node::SPACSimple{FT},
-                p_25::FT
-    ) where {FT<:AbstractFloat}
-
-Update soil moisture and soil matrix potential, given
-- `node` [`SPACSimple`](@ref) type struct
-- `p_25` Given soil maxtrix potential at 25 Celcius
-"""
-function soil_moisture_p25!(
-            node::SPACSimple{FT},
-            p_25::FT
-) where {FT<:AbstractFloat}
-    node.p_soil = p_25 * node.hs.root.f_st;
-    node.swc    = soil_swc(node.hs.root.sh, p_25);
-
-    return nothing
-end
-
-
-
-
-"""
-    soil_moisture!(
-                node::SPACSimple{FT},
-                flow::FT,
-                Δt::FT = FT(1)
-    ) where {FT<:AbstractFloat}
-
-Update soil moisture and soil matrix potential, given
-- `node` [`SPACSimple`](@ref) type struct
-- `flow` Mean outlet flow rate in `[Kg h⁻¹]`
-- `Δt` Time period in `[h]`
-"""
-function soil_moisture!(
-            node::SPACSimple{FT},
-            flow::FT,
-            Δt::FT = FT(1)
-) where {FT<:AbstractFloat}
-    # 1. positive flow means out, flow in Kg h⁻¹, dt in h
-    m_all  = node.swc * node.gaba * node.h_soil * ρ_H₂O(FT);
-    m_out  = flow * Δt;
-    m_all -= m_out;
-    swc    = m_all / (node.gaba * node.h_soil * ρ_H₂O(FT));
-    swc    = max(swc, FT(1e-6));
-
-    soil_moisture_swc!(node, swc);
-
-    return nothing
-end
diff --git a/src/SoilPlantAirContinuum/types/container.jl b/src/SoilPlantAirContinuum/types/container.jl
deleted file mode 100644
index f96b18ad..00000000
--- a/src/SoilPlantAirContinuum/types/container.jl
+++ /dev/null
@@ -1,68 +0,0 @@
-###############################################################################
-#
-# Containers for Simulation results
-#
-###############################################################################
-"""
-    mutable struct SPACContainer1L{FT}
-
-Struct that contains 1-layer gas exchange information.
-
-# Fields
-$(TYPEDFIELDS)
-"""
-Base.@kwdef mutable struct SPACContainer1L{FT<:AbstractFloat}
-    "Mean gross photosynthetic rate `[μmol m⁻² s⁻¹]`"
-    ag::FT = FT(0)
-    "Mean net photosynthetic rate `[μmol m⁻² s⁻¹]`"
-    an::FT = FT(0)
-    "Leaf internal CO₂ partial pressure `[Pa]`"
-    c ::FT = FT(0)
-    "Flow rate per basal area `[mol s⁻¹ m⁻²]`"
-    e ::FT = FT(0)
-    "Leaf diffusive conductance to H₂O `[mol m⁻² s⁻¹]`"
-    gh::FT = FT(0)
-    "Xylem end pressure `[MPa]`"
-    p ::FT = FT(0)
-    "Leaf temperature `[K]`"
-    t ::FT = FT(0)
-end
-
-
-
-
-"""
-    mutable struct SPACContainer2L{FT}
-
-Struct that contains 2-layer gas exchange information.
-
-# Fields
-$(TYPEDFIELDS)
-"""
-Base.@kwdef mutable struct SPACContainer2L{FT<:AbstractFloat}
-    # gas exchange information
-    cont_sh::SPACContainer1L{FT} = SPACContainer1L{FT}();
-    cont_sl::SPACContainer1L{FT} = SPACContainer1L{FT}();
-
-    # partition information
-    "Shaded layer fraction"
-    frac_sh::FT = FT(0)
-    "Sunlit layer fraction"
-    frac_sl::FT = FT(0)
-    "Shaded layer leaf area `[m²]`"
-    la_sh  ::FT = FT(0)
-    "Sunlit layer leaf area `[m²]`"
-    la_sl  ::FT = FT(0)
-    "Shaded layer LAI"
-    lai_sh ::FT = FT(0)
-    "Sunlit layer LAI"
-    lai_sl ::FT = FT(0)
-    "Shaded layer PAR `[μmol m⁻² s⁻¹]`"
-    par_sh ::FT = FT(0)
-    "Sunlit layer PAR `[μmol m⁻² s⁻¹]`"
-    par_sl ::FT = FT(0)
-    "Shaded layer absorbed energy `[W m⁻²]`"
-    rad_sh ::FT = FT(0)
-    "Sunlit layer absorbed energy `[W m⁻²]`"
-    rad_sl ::FT = FT(0)
-end
diff --git a/src/SoilPlantAirContinuum/types/spacmono.jl b/src/SoilPlantAirContinuum/types/spacmono.jl
index 68723e5c..30e66b49 100644
--- a/src/SoilPlantAirContinuum/types/spacmono.jl
+++ b/src/SoilPlantAirContinuum/types/spacmono.jl
@@ -12,10 +12,13 @@ Struct that mono species SoilPlantAirContinuum system.
 $(TYPEDFIELDS)
 """
 Base.@kwdef mutable struct SPACMono{FT<:AbstractFloat}
+    "Input file for SPAC spectra used in wl_set and soil_opt"
+    opti_file::String = LAND_2021
+
     "Soil layers bounds `[m]`"
-    soil_bounds::Array{FT,1} = FT[0,-0.1,-0.2,-0.3,-0.5,-0.8,-1.2,-2.0]
+    soil_bounds::Vector{FT} = FT[0,-0.1,-0.2,-0.3,-0.5,-0.8,-1.2,-2.0]
     "Air layers bounds `[m]`"
-    air_bounds ::Array{FT,1} = collect(FT,0:1:20)
+    air_bounds ::Vector{FT} = collect(FT,0:1:20)
 
     "Root depth `[m]`"
     z_root  ::FT = FT(-1)
@@ -29,7 +32,7 @@ Base.@kwdef mutable struct SPACMono{FT<:AbstractFloat}
     "Number of root layers"
     n_root  ::Int = length(plant_hs.root_index_in_soil)
     "Plant photosynthesis systems"
-    plant_ps::Array{CanopyLayer{FT},1} = [CanopyLayer{FT}() for i in 1:n_canopy]
+    plant_ps::Vector{CanopyLayer{FT}} = [CanopyLayer{FT}() for i in 1:n_canopy]
     "Basal area `[m²]`"
     ba::FT = sum( [plant_hs.roots[i].area for i in 1:n_root] )
     "Ground area `[m²]`"
@@ -39,7 +42,7 @@ Base.@kwdef mutable struct SPACMono{FT<:AbstractFloat}
 
     # Surrounding AirLayer
     "Air layers"
-    envirs::Array{AirLayer{FT},1} = [AirLayer{FT}() for i in 1:n_canopy]
+    envirs::Vector{AirLayer{FT}} = [AirLayer{FT}() for i in 1:n_canopy]
 
     # Wind related
     "Aerodynamic roughness `[m]`"
@@ -47,18 +50,18 @@ Base.@kwdef mutable struct SPACMono{FT<:AbstractFloat}
     "Zero plane displacement `[m]`"
     wind_d ::FT = z_canopy * 2/3
     "Mean layer height `[m]`"
-    wind_zs::Array{FT,1} = [(air_bounds[i]+air_bounds[i+1])/2 for i in 1:length(air_bounds)-1]
+    wind_zs::Vector{FT} = [(air_bounds[i]+air_bounds[i+1])/2 for i in 1:length(air_bounds)-1]
     "Wind speed per layer `[m s⁻¹]`"
-    winds::Array{FT,1} = [FT(1) for i in 1:length(air_bounds)-1]
+    winds::Vector{FT} = [FT(1) for i in 1:length(air_bounds)-1]
 
     # Soil layers information
     # TODO bridge Soil module later
     "Maximal soil water content"
-    mswc  ::Array{FT,1} = [plant_hs.roots[i].sh.Θs for i in 1:n_root]
+    mswc  ::Vector{FT} = [plant_hs.roots[i].sh.Θs for i in 1:n_root]
     "Current soil water content"
-    swc   ::Array{FT,1} = [plant_hs.roots[i].sh.Θs for i in 1:n_root]
+    swc   ::Vector{FT} = [plant_hs.roots[i].sh.Θs for i in 1:n_root]
     "Array of soil matric potential `[MPa]`"
-    p_soil::Array{FT,1} = FT[0 for i in 1:n_root]
+    p_soil::Vector{FT} = FT[0 for i in 1:n_root]
     "Maximal soil depth `[m]`"
     h_soil::FT = abs(z_root)
 
@@ -80,25 +83,25 @@ Base.@kwdef mutable struct SPACMono{FT<:AbstractFloat}
     "Solar angle container"
     angles::SolarAngles{FT} = SolarAngles{FT}()
     "Canopy4RT container"
-    canopy_rt::Canopy4RT{FT} = create_canopy_rt(FT, nLayer=n_canopy, LAI=la/ga)
+    canopy_rt::Canopy4RT{FT} = Canopy4RT{FT}(nLayer = n_canopy, LAI = la/ga)
     "Wave length container"
-    wl_set::WaveLengths{FT} = create_wave_length(FT)
+    wl_set::WaveLengths{FT} = WaveLengths{FT}(opti_file = opti_file)
     "RT dimensions"
-    rt_dim::RTDimensions = create_rt_dims(canopy_rt, wl_set);
+    rt_dim::RTDimensions = RTDimensions(canopy_rt, wl_set)
     "CanopyRads container"
-    can_rad::CanopyRads{FT} = create_canopy_rads(FT, rt_dim)
+    can_rad::CanopyRads{FT} = CanopyRads{FT}(rt_dim)
     "CanopyOpticals container"
-    can_opt::CanopyOpticals{FT} = create_canopy_opticals(FT, rt_dim)
+    can_opt::CanopyOpticals{FT} = CanopyOpticals{FT}(rt_dim)
     "Array of LeafBios container"
-    leaves_rt::Array{LeafBios{FT},1} = [create_leaf_bios(FT, rt_dim) for i in 1:n_canopy]
+    leaves_rt::Vector{LeafBios{FT}} = [LeafBios{FT}(rt_dim) for i in 1:n_canopy]
     "SoilOpticals container"
-    soil_opt::SoilOpticals{FT} = SoilOpticals{FT}(wl_set)
+    soil_opt::SoilOpticals{FT} = SoilOpticals(wl_set)
     "Incoming radiation container"
-    in_rad::IncomingRadiation{FT} = create_incoming_radiation(wl_set)
+    in_rad::IncomingRadiation{FT} = IncomingRadiation(wl_set)
     "RT container"
-    rt_con::RTCache{FT} = create_rt_cache(FT, rt_dim)
+    rt_con::RTCache{FT} = RTCache{FT}(rt_dim)
     "Container for sunlit leaf area fraction in each layer"
-    f_SL::Array{FT,1} = repeat(canopy_rt.lidf, outer=[ canopy_rt.nAzi ]) / canopy_rt.nAzi;
+    f_SL::Vector{FT} = repeat(canopy_rt.lidf, outer=[ canopy_rt.nAzi ]) / canopy_rt.nAzi;
 
     # local storage for canopy GPP and NPP
     "Canopy GPP per ground area"
diff --git a/src/SoilPlantAirContinuum/types/spacsimple.jl b/src/SoilPlantAirContinuum/types/spacsimple.jl
deleted file mode 100644
index f65fb07c..00000000
--- a/src/SoilPlantAirContinuum/types/spacsimple.jl
+++ /dev/null
@@ -1,85 +0,0 @@
-###############################################################################
-#
-# SoilPlantAirContinuum system for simple mono species system
-#
-###############################################################################
-"""
-    mutable struct SPACSimple{FT}
-
-Struct that simplest mono species SoilPlantAirContinuum system, with 1 root,
-    stem, and leaf.
-
-# Fields
-$(TYPEDFIELDS)
-"""
-Base.@kwdef mutable struct SPACSimple{FT<:AbstractFloat}
-    # Hydraulic system
-    "Hydraulic systems"
-    hs::TreeSimple{FT} = TreeSimple{FT}()
-    "Critical flow rate"
-    ec::FT = FT(50);
-
-    # Photosynthesis parameters
-    "Photosynthesis system"
-    ps::Leaf{FT} = Leaf{FT}()
-    "Ratio between Vcmax25 and Jmax25"
-    vtoj::FT = FT(1.67)
-
-    # Surrounding AirLayer
-    "Environmental conditions"
-    envir::AirLayer{FT} = AirLayer{FT}()
-
-    # local container for returned results
-    "Container for gas exchange for a layer"
-    container1L::SPACContainer1L{FT} = SPACContainer1L{FT}()
-    "Container for gas exchange of sunlit and shaded layers"
-    container2L::SPACContainer2L{FT} = SPACContainer2L{FT}()
-    "Container for default hydraulic conductance"
-    containerKS::Array{FT,1} = FT[hs.root.k_max, hs.stem.k_max, hs.leaf.k_sla]
-    "Container for optimizer"
-    containerOP::FT = FT(0)
-    "Container for optimal sunlit layer flow rate"
-    opt_f_sl   ::FT = FT(0)
-    "Container for optimal shaded layer flow rate"
-    opt_f_sh   ::FT = FT(0)
-    "Container for optimal leaf area per basal area"
-    opt_laba   ::FT = FT(2000)
-    "Container for optimal Vcmax25"
-    opt_vmax   ::FT = FT(5)
-
-    # leaf related
-    "Leaf area index"
-    lai  ::FT = FT(3)
-    "Leaf area per basal area"
-    laba ::FT = 1500
-    "Maximal stomatal conductance limit at 25 °C"
-    g_max::FT = 0.8
-    "Ground area per basal area"
-    gaba ::FT = 500
-    "Leaf width"
-    width::FT = 0.05
-
-    # soil related
-    "Maximal soil water content"
-    mswc  ::FT = (hs.root.sh).Θs
-    "Current soil water content"
-    swc   ::FT = (hs.root.sh).Θs
-    "Soil matrical water potential"
-    p_soil::FT = 0.0
-    "Soil depth, 2X mean root depth"
-    h_soil::FT = 2
-
-    # leaf invest related
-    "Leaf construction cost per leaf area"
-    c_cons::FT = 2
-    "Leaf nutrient cost per Vcmax25 per leaf area"
-    c_vmax::FT = 0.04
-
-    # geography related
-    "Latitude `[°]`"
-    latitude ::FT = 30
-    "Longitude `[°]`"
-    longitude::FT = 116
-    "Elevation `[m]`"
-    elevation::FT = 0
-end
diff --git a/src/SoilPlantAirContinuum/wind.jl b/src/SoilPlantAirContinuum/wind.jl
new file mode 100644
index 00000000..661e8284
--- /dev/null
+++ b/src/SoilPlantAirContinuum/wind.jl
@@ -0,0 +1,21 @@
+###############################################################################
+#
+# Leaf boundary layer conductance
+#
+###############################################################################
+"""
+    boundary_layer_conductance(wind::FT, width::FT) where {FT<:AbstractFloat}
+
+Return the boundary layer conductance, given
+- `wind` Wind speed
+- `width` Leaf width
+"""
+function boundary_layer_conductance(
+            wind::FT,
+            width::FT
+) where {FT<:AbstractFloat}
+    _A::FT = FT(1.4 * 0.135)
+    _B::FT = FT(0.72)
+
+    return _A * sqrt( wind / (_B*width) )
+end
diff --git a/src/StomataModels/StomataModels.jl b/src/StomataModels/StomataModels.jl
index 4f725751..1cf03fa7 100644
--- a/src/StomataModels/StomataModels.jl
+++ b/src/StomataModels/StomataModels.jl
@@ -3,7 +3,6 @@ module StomataModels
 using ConstrainedRootSolvers: NewtonBisectionMethod, SolutionTolerance, find_zero
 using DocStringExtensions: TYPEDFIELDS
 using EmeraldConstants: CP_D_MOL, K_STEFAN, M_H₂O, T₂₅
-using UnPack: @unpack
 using WaterPhysics: latent_heat_vapor, relative_diffusive_coefficient, saturation_vapor_pressure
 
 using ..Photosynthesis: AbstractPhotoModelParaSet, AirLayer, GCO₂Mode, Leaf, leaf_ETR!, leaf_fluorescence!, leaf_photosynthesis!, leaf_temperature_dependence!
diff --git a/src/StomataModels/model/beta.jl b/src/StomataModels/model/beta.jl
index bc6f27ba..b9cd8d28 100644
--- a/src/StomataModels/model/beta.jl
+++ b/src/StomataModels/model/beta.jl
@@ -28,7 +28,7 @@ function β_factor(
             p_soil::FT,
             swc::FT
 ) where {FT<:AbstractFloat}
-    @unpack f_st, f_vis, vc = hs;
+    (; f_st, f_vis, vc) = hs;
 
     return xylem_k_ratio(vc, p_leaf/f_st, f_vis)
 end
@@ -58,7 +58,7 @@ function β_factor(
             p_soil::FT,
             swc::FT
 ) where {FT<:AbstractFloat}
-    @unpack p_max, p_min = bt;
+    (; p_max, p_min) = bt;
 
     if p_leaf >= p_max
         return FT(1)
@@ -80,7 +80,7 @@ function β_factor(
             p_soil::FT,
             swc::FT
 ) where {FT<:AbstractFloat}
-    @unpack p_max, p_min = bt;
+    (; p_max, p_min) = bt;
 
     if p_soil >= p_max
         return FT(1)
@@ -102,7 +102,7 @@ function β_factor(
             p_soil::FT,
             swc::FT
 ) where {FT<:AbstractFloat}
-    @unpack swc_max, swc_min = bt;
+    (; swc_max, swc_min) = bt;
 
     if swc >= swc_max
         return FT(1)
diff --git a/src/StomataModels/model/empirical.jl b/src/StomataModels/model/empirical.jl
index 040ca1e6..9f092358 100644
--- a/src/StomataModels/model/empirical.jl
+++ b/src/StomataModels/model/empirical.jl
@@ -33,9 +33,9 @@ Steady state gsw from empirical approach given
 - `ind` Nth leaf in the canopy layer
 """
 function stomatal_conductance(model::ESMBallBerry{FT}, leaf::Leaf{FT}, envir::AirLayer{FT}, β::FT) where {FT<:AbstractFloat}
-    @unpack g0, g1    = model;
-    @unpack An, p_s   = leaf;
-    @unpack p_atm, RH = envir;
+    (; g0, g1) = model;
+    (; An, p_s) = leaf;
+    (; p_atm, RH) = envir;
 
     return g0 + g1 * RH * p_atm * FT(1e-6) * β * An / p_s
 end
@@ -44,9 +44,9 @@ end
 
 
 function stomatal_conductance(model::ESMBallBerry{FT}, canopyi::CanopyLayer{FT}, envir::AirLayer{FT}, β::FT) where {FT<:AbstractFloat}
-    @unpack g0, g1    = model;
-    @unpack An, p_s   = canopyi;
-    @unpack p_atm, RH = envir;
+    (; g0, g1) = model;
+    (; An, p_s) = canopyi;
+    (; p_atm, RH) = envir;
 
     return g0 .+ g1 * RH * p_atm * FT(1e-6) * β .* An ./ p_s
 end
@@ -55,9 +55,9 @@ end
 
 
 function stomatal_conductance(model::ESMBallBerry{FT}, canopyi::CanopyLayer{FT}, envir::AirLayer{FT}, β::FT, ind::Int) where {FT<:AbstractFloat}
-    @unpack g0, g1    = model;
-    @unpack An, p_s   = canopyi;
-    @unpack p_atm, RH = envir;
+    (; g0, g1) = model;
+    (; An, p_s) = canopyi;
+    (; p_atm, RH) = envir;
 
     return g0 + g1 * RH * p_atm * FT(1e-6) * β * An[ind] / p_s[ind]
 end
@@ -66,9 +66,9 @@ end
 
 
 function stomatal_conductance(model::ESMGentine{FT}, leaf::Leaf{FT}, envir::AirLayer{FT}, β::FT) where {FT<:AbstractFloat}
-    @unpack g0, g1  = model;
-    @unpack An, p_i = leaf;
-    @unpack p_atm   = envir;
+    (; g0, g1) = model;
+    (; An, p_i) = leaf;
+    (; p_atm) = envir;
 
     return g0 + g1 * p_atm * FT(1e-6) * β * An / p_i
 end
@@ -77,9 +77,9 @@ end
 
 
 function stomatal_conductance(model::ESMGentine{FT}, canopyi::CanopyLayer{FT}, envir::AirLayer{FT}, β::FT) where {FT<:AbstractFloat}
-    @unpack g0, g1  = model;
-    @unpack An, p_i = canopyi;
-    @unpack p_atm   = envir;
+    (; g0, g1) = model;
+    (; An, p_i) = canopyi;
+    (; p_atm) = envir;
 
     return g0 .+ g1 * p_atm * FT(1e-6) * β .* An ./ p_i
 end
@@ -88,9 +88,9 @@ end
 
 
 function stomatal_conductance(model::ESMGentine{FT}, canopyi::CanopyLayer{FT}, envir::AirLayer{FT}, β::FT, ind::Int) where {FT<:AbstractFloat}
-    @unpack g0, g1  = model;
-    @unpack An, p_i = canopyi;
-    @unpack p_atm   = envir;
+    (; g0, g1) = model;
+    (; An, p_i) = canopyi;
+    (; p_atm) = envir;
 
     return g0 + g1 * p_atm * FT(1e-6) * β * An[ind] / p_i[ind]
 end
@@ -99,9 +99,9 @@ end
 
 
 function stomatal_conductance(model::ESMLeuning{FT}, leaf::Leaf{FT}, envir::AirLayer{FT}, β::FT) where {FT<:AbstractFloat}
-    @unpack d0, g0, g1             = model;
-    @unpack An, p_s, p_sat, Γ_star = leaf;
-    @unpack p_atm, p_H₂O           = envir;
+    (; d0, g0, g1) = model;
+    (; An, p_s, p_sat, Γ_star) = leaf;
+    (; p_atm, p_H₂O) = envir;
 
     return g0 + g1 * p_atm * FT(1e-6) / (1 + (p_sat - p_H₂O)/d0) * β * An / (p_s - Γ_star)
 end
@@ -110,10 +110,10 @@ end
 
 
 function stomatal_conductance(model::ESMLeuning{FT}, canopyi::CanopyLayer{FT}, envir::AirLayer{FT}, β::FT) where {FT<:AbstractFloat}
-    @unpack d0, g0, g1     = model;
-    @unpack An, p_s, p_sat = canopyi;
-    @unpack Γ_star         = canopyi.ps;
-    @unpack p_atm, p_H₂O   = envir;
+    (; d0, g0, g1) = model;
+    (; An, p_s, p_sat) = canopyi;
+    (; Γ_star) = canopyi.ps;
+    (; p_atm, p_H₂O) = envir;
 
     return g0 .+ g1 * p_atm * FT(1e-6) / (1 + (p_sat - p_H₂O)/d0) * β .* An ./ (p_s .- Γ_star)
 end
@@ -122,10 +122,10 @@ end
 
 
 function stomatal_conductance(model::ESMLeuning{FT}, canopyi::CanopyLayer{FT}, envir::AirLayer{FT}, β::FT, ind::Int) where {FT<:AbstractFloat}
-    @unpack d0, g0, g1     = model;
-    @unpack An, p_s, p_sat = canopyi;
-    @unpack Γ_star         = canopyi.ps;
-    @unpack p_atm, p_H₂O   = envir;
+    (; d0, g0, g1) = model;
+    (; An, p_s, p_sat) = canopyi;
+    (; Γ_star) = canopyi.ps;
+    (; p_atm, p_H₂O) = envir;
 
     return g0 + g1 * p_atm * FT(1e-6) / (1 + (p_sat - p_H₂O)/d0) * β * An[ind] / (p_s[ind] - Γ_star)
 end
@@ -134,9 +134,9 @@ end
 
 
 function stomatal_conductance(model::ESMMedlyn{FT}, leaf::Leaf{FT}, envir::AirLayer{FT}, β::FT) where {FT<:AbstractFloat}
-    @unpack g0, g1            = model;
-    @unpack An, p_sat         = leaf;
-    @unpack p_a, p_atm, p_H₂O = envir;
+    (; g0, g1) = model;
+    (; An, p_sat) = leaf;
+    (; p_a, p_atm, p_H₂O) = envir;
     vpd = max(FT(0.001), p_sat - p_H₂O);
 
     return g0 + p_atm * FT(1e-6) / p_a * (1 + g1/sqrt(vpd)) * β * An * FT(1.6)
@@ -146,9 +146,9 @@ end
 
 
 function stomatal_conductance(model::ESMMedlyn{FT}, canopyi::CanopyLayer{FT}, envir::AirLayer{FT}, β::FT) where {FT<:AbstractFloat}
-    @unpack g0, g1            = model;
-    @unpack An, p_sat         = canopyi;
-    @unpack p_a, p_atm, p_H₂O = envir;
+    (; g0, g1) = model;
+    (; An, p_sat) = canopyi;
+    (; p_a, p_atm, p_H₂O) = envir;
     vpd = max(FT(0.001), p_sat - p_H₂O);
 
     return g0 .+ p_atm * FT(1e-6) / p_a * (1 + g1/sqrt(vpd)) * β .* An * FT(1.6)
@@ -158,9 +158,9 @@ end
 
 
 function stomatal_conductance(model::ESMMedlyn{FT}, canopyi::CanopyLayer{FT}, envir::AirLayer{FT}, β::FT, ind::Int) where {FT<:AbstractFloat}
-    @unpack g0, g1            = model;
-    @unpack An, p_sat         = canopyi;
-    @unpack p_a, p_atm, p_H₂O = envir;
+    (; g0, g1) = model;
+    (; An, p_sat) = canopyi;
+    (; p_a, p_atm, p_H₂O) = envir;
     vpd = max(FT(0.001), p_sat - p_H₂O);
 
     return g0 + p_atm * FT(1e-6) / p_a * (1 + g1/sqrt(vpd)) * β * An[ind] * FT(1.6)
diff --git a/src/StomataModels/model/gasexchange.jl b/src/StomataModels/model/gasexchange.jl
index dcf0e1ae..cf493fdd 100644
--- a/src/StomataModels/model/gasexchange.jl
+++ b/src/StomataModels/model/gasexchange.jl
@@ -158,8 +158,8 @@ function gas_exchange!(
 ) where {FT<:AbstractFloat}
     if canopyi.APAR[ind] > 1
         # unpack required variables
-        @unpack ec, g_max, g_min, p_sat = canopyi;
-        @unpack p_atm, p_H₂O = envir;
+        (; ec, g_max, g_min, p_sat) = canopyi;
+        (; p_atm, p_H₂O) = envir;
         _g_bc = canopyi.g_bc[ind];
         _g_bw = canopyi.g_bw[ind];
         _g_m  = canopyi.g_m[ind];
@@ -222,8 +222,8 @@ function gas_exchange!(
     # if there is light
     if canopyi.APAR[ind] > 1
         # unpack required variables
-        @unpack ec, g_max, g_min, p_sat = canopyi;
-        @unpack p_atm, p_H₂O = envir;
+        (; ec, g_max, g_min, p_sat) = canopyi;
+        (; p_atm, p_H₂O) = envir;
         _g_bc   = canopyi.g_bc[ind];
         _g_bw   = canopyi.g_bw[ind];
         _g_m    = canopyi.g_m[ind];
@@ -263,8 +263,8 @@ function gas_exchange!(
 
     # if there is no light, use nighttime mode
     else
-        @unpack ec, g_max, g_min, p_sat = canopyi;
-        @unpack p_atm, p_H₂O = envir;
+        (; ec, g_max, g_min, p_sat) = canopyi;
+        (; p_atm, p_H₂O) = envir;
         _sm = NewtonBisectionMethod{FT}(x_min=g_min, x_max=g_max);
         _st = SolutionTolerance{FT}(1e-4, 50);
         @inline fn(x) = nocturnal_diff!(x, photo_set, canopyi, envir, sm);
@@ -294,8 +294,8 @@ function gas_exchange!(
     # if there is light
     if canopyi.APAR[ind] > 1
         # unpack required variables
-        @unpack ec, g_max, g_min, p_sat = canopyi;
-        @unpack p_atm, p_H₂O = envir;
+        (; ec, g_max, g_min, p_sat) = canopyi;
+        (; p_atm, p_H₂O) = envir;
         _g_bc   = canopyi.g_bc[ind];
         _g_bw   = canopyi.g_bw[ind];
         _g_m    = canopyi.g_m[ind];
@@ -359,8 +359,8 @@ function gas_exchange!(
     # if there is light
     if canopyi.APAR[ind] > 1
         # unpack required variables
-        @unpack ec, g_max, g_min, p_sat = canopyi;
-        @unpack p_atm, p_H₂O = envir;
+        (; ec, g_max, g_min, p_sat) = canopyi;
+        (; p_atm, p_H₂O) = envir;
         _g_bc   = canopyi.g_bc[ind];
         _g_bw   = canopyi.g_bw[ind];
         _g_m    = canopyi.g_m[ind];
@@ -544,7 +544,7 @@ function gas_exchange!(
             drive::GswDrive,
             ind::Int
 ) where {FT<:AbstractFloat}
-    @unpack g_max, g_min = canopyi;
+    (; g_max, g_min) = canopyi;
 
     # update the conductances
     if canopyi.g_sw[ind] > g_max
diff --git a/src/StomataModels/model/nocturnal.jl b/src/StomataModels/model/nocturnal.jl
index 0f55122a..43797934 100644
--- a/src/StomataModels/model/nocturnal.jl
+++ b/src/StomataModels/model/nocturnal.jl
@@ -22,8 +22,8 @@ function dRdE(
             clayer::CanopyLayer{FT},
             envir::AirLayer{FT}
 ) where {FT<:AbstractFloat}
-    @unpack ps, T = clayer;
-    @unpack Rd = ps;
+    (; ps, T) = clayer;
+    (; Rd) = ps;
 
     return dTdE(clayer, envir) * Rd * photo_set.ReT.ΔHa_to_RT25 * T₂₅(FT) / T^2
 end
@@ -45,8 +45,8 @@ function dTdE(
             clayer::CanopyLayer{FT},
             envir::AirLayer{FT}
 ) where {FT<:AbstractFloat}
-    @unpack T, tLAI, width = clayer;
-    @unpack wind = envir;
+    (; T, tLAI, width) = clayer;
+    (; wind) = envir;
 
     lambda = latent_heat_vapor(T) * M_H₂O(FT);
     gbe    = FT(0.189 * sqrt(wind/(0.72*width)));
@@ -80,8 +80,8 @@ function dΘdE(
             sm::OSMWang{FT},
             g_sw::FT
 ) where {FT<:AbstractFloat}
-    @unpack APAR_m, ec, envir_m, ff, ps_m = clayer;
-    @unpack p_atm, p_H₂O = envir_m
+    (; APAR_m, ec, envir_m, ff, ps_m) = clayer;
+    (; p_atm, p_H₂O) = envir_m;
     ps_m.APAR = APAR_m;
 
     # calculate g_lc and a_net using memory clayer and envir
diff --git a/src/StomataModels/model/prognostic.jl b/src/StomataModels/model/prognostic.jl
index 46a28520..3440b549 100644
--- a/src/StomataModels/model/prognostic.jl
+++ b/src/StomataModels/model/prognostic.jl
@@ -34,7 +34,7 @@ function prognostic_gsw! end
 
 prognostic_gsw!(clayer::CanopyLayer{FT}, envir::AirLayer{FT}, sm::EmpiricalStomatalModel{FT}, β::FT, Δt::FT) where {FT<:AbstractFloat} = (
     # unpack values
-    @unpack g_bc, g_bw, g_lc, g_lw, g_m, g_sc, g_sw, n_leaf = clayer;
+    (; g_bc, g_bw, g_lc, g_lw, g_m, g_sc, g_sw, n_leaf) = clayer;
 
     # update g_sw
     for iLF in 1:n_leaf
@@ -52,7 +52,7 @@ prognostic_gsw!(clayer::CanopyLayer{FT}, envir::AirLayer{FT}, sm::EmpiricalStoma
 
 prognostic_gsw!(photo_set::AbstractPhotoModelParaSet{FT}, clayer::CanopyLayer{FT}, hs::LeafHydraulics{FT}, envir::AirLayer{FT}, sm::OSMWang{FT}, Δt::FT) where {FT<:AbstractFloat} = (
     # unpack values
-    @unpack APAR, g_bc, g_bw, g_lc, g_lw, g_m, g_sc, g_sw, n_leaf = clayer;
+    (; APAR, g_bc, g_bw, g_lc, g_lw, g_m, g_sc, g_sw, n_leaf) = clayer;
 
     # update g_sw
     for iLF in 1:n_leaf
diff --git a/src/StomataModels/model/refresh.jl b/src/StomataModels/model/refresh.jl
index a1a0ba2f..58d1378f 100644
--- a/src/StomataModels/model/refresh.jl
+++ b/src/StomataModels/model/refresh.jl
@@ -25,7 +25,7 @@ function update_leaf_TP!(
             envir::AirLayer{FT}
 ) where {FT<:AbstractFloat}
     # unpack required variables
-    @unpack g_max25, g_min25, p_ups, p_old, T, T_old = canopyi;
+    (; g_max25, g_min25, p_ups, p_old, T, T_old) = canopyi;
 
     # if T changes, update TD and ec, then T_old
     if T != T_old
@@ -60,7 +60,7 @@ function update_leaf_TP!(
             envir::AirLayer{FT}
 ) where {FT<:AbstractFloat}
     # unpack required variables
-    @unpack g_max25, g_min25, p_ups, p_old, T, T_old = canopyi;
+    (; g_max25, g_min25, p_ups, p_old, T, T_old) = canopyi;
 
     # note that canopyi.p_ups is not used here
     # if T changes, update TD and ec, then T_old
@@ -118,8 +118,8 @@ function update_leaf_AK!(
             envir::AirLayer{FT}
 ) where {FT<:AbstractFloat}
     # unpack required variables
-    @unpack APAR, ec, g_bc, g_bw, g_m, g_max, g_min, p_sat = canopyi;
-    @unpack p_atm, p_H₂O = envir;
+    (; APAR, ec, g_bc, g_bw, g_m, g_max, g_min, p_sat) = canopyi;
+    (; p_atm, p_H₂O) = envir;
 
     # calculate the physiological maximal g_sw
     _g_crit = ec / (p_sat - p_H₂O) * p_atm;
diff --git a/src/StomataModels/model/solution.jl b/src/StomataModels/model/solution.jl
index 6485fe63..dae2e0b1 100644
--- a/src/StomataModels/model/solution.jl
+++ b/src/StomataModels/model/solution.jl
@@ -59,7 +59,7 @@ function solution_diff!(
             ind::Int
 ) where {FT<:AbstractFloat}
     # unpack variables
-    @unpack ps = canopyi;
+    (; ps) = canopyi;
     g_bc  = canopyi.g_bc[ind];
     g_m   = canopyi.g_m[ind];
 
@@ -150,8 +150,8 @@ function solution_diff!(
             ind::Int
 ) where {FT<:AbstractFloat}
     # unpack variables
-    @unpack g_max, g_min, p_sat, ps = canopyi;
-    @unpack p_atm, p_H₂O = envir;
+    (; g_max, g_min, p_sat, ps) = canopyi;
+    (; p_atm, p_H₂O) = envir;
     g_bc = canopyi.g_bc[ind];
     g_bw = canopyi.g_bw[ind];
     g_m  = canopyi.g_m[ind];
@@ -223,8 +223,8 @@ function solution_diff!(
             ind::Int
 ) where {FT<:AbstractFloat}
     # unpack variables
-    @unpack g_max, g_min, kr_max, p_sat, ps = canopyi;
-    @unpack p_atm, p_H₂O = envir;
+    (; g_max, g_min, kr_max, p_sat, ps) = canopyi;
+    (; p_atm, p_H₂O) = envir;
     a_max = canopyi.a_max[ind];
     g_bc  = canopyi.g_bc[ind];
     g_bw  = canopyi.g_bw[ind];
@@ -297,8 +297,8 @@ function solution_diff!(
             ind::Int
 ) where {FT<:AbstractFloat}
     # unpack variables
-    @unpack ec, g_max, g_min, p_sat, ps = canopyi;
-    @unpack p_atm, p_H₂O = envir;
+    (; ec, g_max, g_min, p_sat, ps) = canopyi;
+    (; p_atm, p_H₂O) = envir;
     g_bc  = canopyi.g_bc[ind];
     g_bw  = canopyi.g_bw[ind];
     g_m   = canopyi.g_m[ind];
@@ -368,8 +368,8 @@ function solution_diff!(
             ind::Int
 ) where {FT<:AbstractFloat}
     # unpack variables
-    @unpack g_max, g_min, p_sat, ps = canopyi;
-    @unpack p_atm, p_H₂O = envir;
+    (; g_max, g_min, p_sat, ps) = canopyi;
+    (; p_atm, p_H₂O) = envir;
     g_bc = canopyi.g_bc[ind];
     g_bw = canopyi.g_bw[ind];
     g_m  = canopyi.g_m[ind];
@@ -441,8 +441,8 @@ function solution_diff!(
             ind::Int
 ) where {FT<:AbstractFloat}
     # unpack variables
-    @unpack g_max, g_min, p_sat, ps = canopyi;
-    @unpack p_atm, p_H₂O = envir;
+    (; g_max, g_min, p_sat, ps) = canopyi;
+    (; p_atm, p_H₂O) = envir;
     g_bc = canopyi.g_bc[ind];
     g_bw = canopyi.g_bw[ind];
     g_m  = canopyi.g_m[ind];
@@ -515,8 +515,8 @@ function solution_diff!(
 ) where {FT<:AbstractFloat}
     # gsw has already been guaranteed to be in the range
     # unpack variables
-    @unpack ec, g_max, g_min, p_sat, ps = canopyi;
-    @unpack p_atm, p_H₂O = envir;
+    (; ec, g_max, g_min, p_sat, ps) = canopyi;
+    (; p_atm, p_H₂O) = envir;
     g_bc = canopyi.g_bc[ind];
     g_bw = canopyi.g_bw[ind];
     g_m  = canopyi.g_m[ind];
diff --git a/src/StomataModels/types/canopylayer.jl b/src/StomataModels/types/canopylayer.jl
index af24bbe3..688f6123 100644
--- a/src/StomataModels/types/canopylayer.jl
+++ b/src/StomataModels/types/canopylayer.jl
@@ -33,11 +33,11 @@ Base.@kwdef mutable struct CanopyLayer{FT<:AbstractFloat}
 
     # Temperature related, different for each leaf
     "Sensible Heat Flux `[W m⁻²]`"
-    H ::Array{FT,1} = zeros(FT, n_leaf)
+    H ::Vector{FT} = zeros(FT, n_leaf)
     "Latent Heat Flux `[W m⁻²]`"
-    LE::Array{FT,1} = zeros(FT, n_leaf)
+    LE::Vector{FT} = zeros(FT, n_leaf)
     "Net Radiation Balance `[W m⁻²]`"
-    Rn::Array{FT,1} = zeros(FT, n_leaf)
+    Rn::Vector{FT} = zeros(FT, n_leaf)
 
     # Tempearture related, same for all leaves
     "Latent Heat of evaporation `[J mol⁻¹]`"
@@ -51,21 +51,21 @@ Base.@kwdef mutable struct CanopyLayer{FT<:AbstractFloat}
 
     # Diffusive conductances, same for all leaves
     "Boundary layer conductance to CO₂ `[mol m⁻² s⁻¹]`"
-    g_bc::Array{FT,1} = zeros(FT, n_leaf) .+ FT(3/1.35)
+    g_bc::Vector{FT} = zeros(FT, n_leaf) .+ FT(3/1.35)
     "Boundary layer conductance to heat `[mol m⁻² s⁻¹]`"
-    g_bh::Array{FT,1} = zeros(FT, n_leaf) .+ FT(3)
+    g_bh::Vector{FT} = zeros(FT, n_leaf) .+ FT(3)
     "Boundary layer conductance to H₂O `[mol m⁻² s⁻¹]`"
-    g_bw::Array{FT,1} = zeros(FT, n_leaf) .+ FT(3)
+    g_bw::Vector{FT} = zeros(FT, n_leaf) .+ FT(3)
     "Leaf diffusive conductance to water CO₂ `[mol m⁻² s⁻¹]`"
-    g_lc::Array{FT,1} = zeros(FT, n_leaf) .+ FT(0.08032)
+    g_lc::Vector{FT} = zeros(FT, n_leaf) .+ FT(0.08032)
     "Leaf diffusive conductance to water H₂O `[mol m⁻² s⁻¹]`"
-    g_lw::Array{FT,1} = zeros(FT, n_leaf) .+ FT(0.1519)
+    g_lw::Vector{FT} = zeros(FT, n_leaf) .+ FT(0.1519)
     "Mesophyll conductance for CO₂ `[mol m⁻² s⁻¹]`"
-    g_m ::Array{FT,1} = zeros(FT, n_leaf) .+ FT(0.5)
+    g_m ::Vector{FT} = zeros(FT, n_leaf) .+ FT(0.5)
     "Stomatal conductance to water CO₂ `[mol m⁻² s⁻¹]`"
-    g_sc::Array{FT,1} = zeros(FT, n_leaf) .+ FT(0.1)
+    g_sc::Vector{FT} = zeros(FT, n_leaf) .+ FT(0.1)
     "Stomatal conductance to water H₂O `[mol m⁻² s⁻¹]`"
-    g_sw::Array{FT,1} = zeros(FT, n_leaf) .+ FT(0.16)
+    g_sw::Vector{FT} = zeros(FT, n_leaf) .+ FT(0.16)
 
     # Diffusive conductances, same for all leaves
     "Gias correction constant"
@@ -83,9 +83,9 @@ Base.@kwdef mutable struct CanopyLayer{FT<:AbstractFloat}
 
     # CO₂ and H₂O pressures, different for each leaf
     "Leaf internal CO₂ partial pressure `[Pa]`"
-    p_i::Array{FT,1} = zeros(FT, n_leaf) .+ FT(10)
+    p_i::Vector{FT} = zeros(FT, n_leaf) .+ FT(10)
     "Leaf surface CO₂ partial pressure `[Pa]`"
-    p_s::Array{FT,1} = zeros(FT, n_leaf) .+ FT(40)
+    p_s::Vector{FT} = zeros(FT, n_leaf) .+ FT(40)
 
     # CO₂ and H₂O pressures, same for all leaves
     "Leaf saturation vapor pressure `[Pa]`"
@@ -93,39 +93,39 @@ Base.@kwdef mutable struct CanopyLayer{FT<:AbstractFloat}
 
     # Photosynthesis related, different for each leaf
     "RubisCO limited photosynthetic rate `[μmol m⁻² s⁻¹]`"
-    Ac   ::Array{FT,1} = zeros(FT, n_leaf)
+    Ac   ::Vector{FT} = zeros(FT, n_leaf)
     "Light limited photosynthetic rate `[μmol m⁻² s⁻¹]`"
-    Aj   ::Array{FT,1} = zeros(FT, n_leaf)
+    Aj   ::Vector{FT} = zeros(FT, n_leaf)
     "Gross photosynthetic rate `[μmol m⁻² s⁻¹]`"
-    Ag   ::Array{FT,1} = zeros(FT, n_leaf)
+    Ag   ::Vector{FT} = zeros(FT, n_leaf)
     "Net photosynthetic rate `[μmol m⁻² s⁻¹]`"
-    An   ::Array{FT,1} = zeros(FT, n_leaf)
+    An   ::Vector{FT} = zeros(FT, n_leaf)
     "Product limited photosynthetic rate `[μmol m⁻² s⁻¹]`"
-    Ap   ::Array{FT,1} = zeros(FT, n_leaf)
+    Ap   ::Vector{FT} = zeros(FT, n_leaf)
     "Electron transport `[μmol m⁻² s⁻¹]`"
-    J    ::Array{FT,1} = zeros(FT, n_leaf)
+    J    ::Vector{FT} = zeros(FT, n_leaf)
     "Potential Electron Transport Rate `[μmol m⁻² s⁻¹]`"
-    J_pot::Array{FT,1} = zeros(FT, n_leaf)
+    J_pot::Vector{FT} = zeros(FT, n_leaf)
 
     # Fluorescence related, different for each leaf
     "Total efficiency, incl. photorespiration `[mol CO₂ mol⁻¹ e-]`"
-    e2c::Array{FT,1} = zeros(FT, n_leaf) .+ FT(1/6)
+    e2c::Vector{FT} = zeros(FT, n_leaf) .+ FT(1/6)
     "light adapted yield (`Kp=0`)"
-    Fm′::Array{FT,1} = zeros(FT, n_leaf)
+    Fm′::Vector{FT} = zeros(FT, n_leaf)
     "light-adapted fluorescence yield in the dark (`Kp=max`)"
-    Fo′::Array{FT,1} = zeros(FT, n_leaf)
+    Fo′::Vector{FT} = zeros(FT, n_leaf)
     "Actual electron transport rate `[μmol m⁻² s⁻¹]`"
-    Ja ::Array{FT,1} = zeros(FT, n_leaf)
+    Ja ::Vector{FT} = zeros(FT, n_leaf)
     "Non-Photochemical quenching "
-    NPQ::Array{FT,1} = zeros(FT, n_leaf)
+    NPQ::Vector{FT} = zeros(FT, n_leaf)
     "Photochemical quenching"
-    qQ ::Array{FT,1} = zeros(FT, n_leaf)
+    qQ ::Vector{FT} = zeros(FT, n_leaf)
     "energy quenching"
-    qE ::Array{FT,1} = zeros(FT, n_leaf)
+    qE ::Vector{FT} = zeros(FT, n_leaf)
     "PSII yield"
-    φ  ::Array{FT,1} = zeros(FT, n_leaf)
+    φ  ::Vector{FT} = zeros(FT, n_leaf)
     "Steady-state (light-adapted) yield (aka Fs)"
-    φs ::Array{FT,1} = zeros(FT, n_leaf)
+    φs ::Vector{FT} = zeros(FT, n_leaf)
 
     # Fluorescence related, same for all leaves
     "dark adapted yield (`Kp=0`)"
@@ -135,15 +135,15 @@ Base.@kwdef mutable struct CanopyLayer{FT<:AbstractFloat}
 
     # Environment related, different for each leaf
     "Absorbed photosynthetic active radiation `[μmol m⁻² s⁻¹]`"
-    APAR::Array{FT,1} = zeros(FT, n_leaf) .+ 100
+    APAR::Vector{FT} = zeros(FT, n_leaf) .+ 100
     "Leaf area fractions"
-    LAIx::Array{FT,1} = ones(FT, n_leaf) ./ n_leaf;
+    LAIx::Vector{FT} = ones(FT, n_leaf) ./ n_leaf;
 
     # Stomtal optimization related, different for each leaf
     "Maximal photosynthetic rate `[μmol m⁻² s⁻¹]`"
-    a_max::Array{FT,1} = zeros(FT, n_leaf)
+    a_max::Vector{FT} = zeros(FT, n_leaf)
     "Flow rate `[mol m⁻² s⁻¹]`"
-    e    ::Array{FT,1} = zeros(FT, n_leaf)
+    e    ::Vector{FT} = zeros(FT, n_leaf)
 
     # Stomtal optimization related, same for all leaves
     "Critical flow rate `[mol m⁻² s⁻¹]`"
diff --git a/src/orphan/PhysCon.jl b/src/orphan/PhysCon.jl
deleted file mode 100644
index 2df258e6..00000000
--- a/src/orphan/PhysCon.jl
+++ /dev/null
@@ -1,9 +0,0 @@
-# TODO Move the constants to CLIMAParameters or LandParameters
-Base.@kwdef struct phys{T<:Number}
-    visc_0::T = 13.3e-06;            # Kinematic viscosity at 0C and 1013.25 hPa (m2/s)
-    Dh_0::T = 18.9e-06;              # Molecular diffusivity (heat) at 0C and 1013.25 hPa (m2/s)
-    Dv_0::T = 21.8e-06;              # Molecular diffusivity (H2O) at 0C and 1013.25 hPa (m2/s)
-    Dc_0::T = 13.8e-06;              # Molecular diffusivity (CO2) at 0C and 1013.25 hPa (m2/s)
-    Wtoμmole_s::T = 4.57;            # converts Watts/m2 to μmole/s
-    Cdryleaf::T = 1396;              # Specific heat of dry leaf at constant pressure (J/kg/K)
-end
diff --git a/src/orphan/SPAC_in_development.jl b/src/orphan/SPAC_in_development.jl
index 14efe9aa..593bf512 100644
--- a/src/orphan/SPAC_in_development.jl
+++ b/src/orphan/SPAC_in_development.jl
@@ -86,27 +86,27 @@ Base.@kwdef mutable struct SPACGrid{FT}
     "Total number of vertical layers below ground"
     n_below::Int = 10
     "A list of upper z for the veritical layers above ground `[m]`"
-    zl_above    ::Array{FT,1} = collect(FT,  1.0: 1.0:20.0)
+    zl_above    ::Vector{FT} = collect(FT,  1.0: 1.0:20.0)
     "A list of lower z for the veritical layers below ground `[m]`"
-    al_below    ::Array{FT,1} = collect(FT, -0.2:-0.2:-2.0)
+    al_below    ::Vector{FT} = collect(FT, -0.2:-0.2:-2.0)
     "An array of CO₂ partial pressure along the vertical layers `[Pa]`"
-    p_CO₂_array ::Array{FT,1} = zeros(FT, n_above) + 40
+    p_CO₂_array ::Vector{FT} = zeros(FT, n_above) + 40
     "An array of H₂O partial pressure along the vertical layers `[Pa]`"
-    p_H₂O_array ::Array{FT,1} = zeros(FT, n_above) + 1500
+    p_H₂O_array ::Vector{FT} = zeros(FT, n_above) + 1500
     "An array of soil water potential `[MPa]`"
-    p_soil_array::Array{FT,1} = zeros(FT, n_above) + FT(-0.5)
+    p_soil_array::Vector{FT} = zeros(FT, n_above) + FT(-0.5)
     "An array of soil water content"
-    swc_array   ::Array{FT,1} = zeros(FT, n_above) + FT(0.4)
+    swc_array   ::Vector{FT} = zeros(FT, n_above) + FT(0.4)
     "An array of air temperature `[K]`"
-    t_air_array ::Array{FT,1} = zeros(FT, n_above) + FT(298.15)
+    t_air_array ::Vector{FT} = zeros(FT, n_above) + FT(298.15)
     "An array of soil temperature `[K]`"
-    t_soil_array::Array{FT,1} = zeros(FT, n_above) + FT(298.15)
+    t_soil_array::Vector{FT} = zeros(FT, n_above) + FT(298.15)
 
     # Plant information
     "An array of trees in the grid"
     tree_array::Array = []
     "An array of tree density in the grid"
-    density_array::Array{FT,1} = []
+    density_array::Vector{FT} = []
 end
 
 
diff --git a/src/orphan/Type_in_development.jl b/src/orphan/Type_in_development.jl
deleted file mode 100644
index 337148ca..00000000
--- a/src/orphan/Type_in_development.jl
+++ /dev/null
@@ -1,141 +0,0 @@
-#=
-###############################################################################
-#
-# Leaf photosynthesis-related parameter set
-# This struct passed the FT test
-# This struct is documented in the Leaf page
-# More documentation required
-#
-###############################################################################
-"""
-    LeafParams{FT<:AbstractFloat}
-
-A structure that contains all parameters for photosynthesis calculations of a single leaf.
-
-# Fields
-$(DocStringExtensions.FIELDS)
-"""
-Base.@kwdef mutable struct LeafParams{FT<:AbstractFloat}
-    # TODO Group these variables
-
-    # broadband albedo and emissivity
-    "broadband shortwave albedo"
-    α::FT = -999
-    "longwave emissivity"
-    ε::FT = -999
-
-    # thermal-related characteristics
-    "Leaf dry mass per area `[kg m⁻²]`, not WET mass"
-    LMA::FT = 0.1
-    "leaf relative water content"
-    RWC::FT = 0.8
-    "leaf specific heat capacity `[J kg⁻¹ K⁻¹]`"
-    Cleaf::FT = 1000.0
-
-    # TODO remove? pore density in pores/m^2
-    #pore_density::FT = 1e8
-
-    # chloroplast volume airspace (m^3 per pore)
-    # http://kirschner.med.harvard.edu/files/bionumbers/A%20semi%20quantitative%20analysis%20of%20the%20photosynthetic%20system%20in%20an%20'average'%20C3%20plant%20leaf.pdf
-    "Chloroplast volume airspace `[m³ per pore]`"
-    Chloroplast_rel_volume::FT = 2.0/100.0
-
-    # Photosynthesis
-    "Kn in steady state"
-    Kn_ss::FT = 0
-
-    # Fluorescence-related
-    "Dynamic Steady state `[Bool]`"
-    dynamic_state::Bool = false
-
-    # number of CO₂ per electrons - typically 1/5 for C3 and 1/6 for C4, i.e. about 1/10 for both PSI and PSII!
-    "Efficiency of photosynthesis light reactions`[mol CO₂/mol e-]`"
-    effcon::FT = 1/5
-
-    "Derivative of saturation vapor pressure at leaf temperature wrt T `[Pa/K]`"
-    desat::FT = 0.0
-
-    "Steady state Stomatal conductance `[mol H₂O m⁻² s⁻¹]`"
-    gs_ss::FT = 0.1
-
-    # TODO Update this with Plant Hydraulics
-    "Sap flow `[?]`"
-    Sap::FT = 0;
-    "relative humidity at the surface of the leaf `[-]`"
-    RH::FT = 100.0
-
-    # VPD gradient ACROSS THE LEAF interface - NOT the weather station one 8-)
-    "Vapor pressure difference across leaf interface `[Pa]`"
-    VPD::FT = 0.1
-
-    # TODO add elastic modulus? and P-V curve?
-    #ε_modulus::FT = 20e6
-
-    # TODO link to Plant Hydraulics
-    "tree height `[m]`"
-    height = 20
-    # -Scholz et al. 2011 Book, Hydraulic Capacitance: Biophysics and Functional Significance,
-    # can also be related to P50 see same book
-    "tree capacitance `[kg m⁻³ Pa⁻¹]`"
-    Ctree::FT = (79 + 8*height)*1e-6;
-
-    "Tree roughness `[m]`"
-    z0m::FT= -999.
-    # TODO should be changed later
-    "tree roughness `[m]`"
-    z0h::FT= -999.
-    "tree displacement height `[m]`"
-    d::FT = -999.
-
-    "leaf thickness (m)"
-    dleaf::FT = 2e-3
-    "Leaf area index"
-    LAI::FT= 1.0
-    "turbulent transfer coefficient `[m s``^2``]`"
-    Cd::FT= 0.01
-end
-
-
-
-
-
-
-
-
-###############################################################################
-#
-# Meteo data set
-# This struct passed the FT test
-# More documentation required
-#
-###############################################################################
-"""
-    struct MeteoParams{FT}
-
-A Placeholder for all Meteo data for the moment
-
-# Fields
-$(DocStringExtensions.FIELDS)
-"""
-Base.@kwdef mutable struct MeteoParams{FT<:Number}
-    # TODO Make this struct work first, then clean it up
-    "?"
-    S_down::FT = 0.0
-    "?"
-    L_down::FT = 0.0
-
-    "Measurement height `[m]`"
-    zscreen::FT= 10.0
-    "atmospheric Obukhov length"
-    L::FT      = 1e6
-
-    # parameter to define stability function for stable case
-    "2 Webb correction tends to be unstable at night - suggest not using"
-    stab_type_stable::FT = 1
-    "?"
-    ustar::FT = 1e-6
-
-    "Air resistance `[Pa]`"
-    ra::FT    = 1e6
-end
-=#
diff --git a/src/orphan/vertical_canopy_structure.jl b/src/orphan/vertical_canopy_structure.jl
index cf06d72f..28fce312 100644
--- a/src/orphan/vertical_canopy_structure.jl
+++ b/src/orphan/vertical_canopy_structure.jl
@@ -16,7 +16,7 @@ end
 
 # Bonan ML canopy distribution (Beta function):
 function convert_z_to_dLAI!(mod::BetaCanopyStructure, canopy, z)
-    @unpack LAI, nlayers, h = canopy
+    (; LAI, nlayers, h) = canopy
     # LAI = Leaf Area Index
     # h = Canopy height
     LAI * cdf.(mod.B,z/h)
diff --git a/test/features/clm5_mode.jl b/test/features/clm5_mode.jl
new file mode 100644
index 00000000..984312de
--- /dev/null
+++ b/test/features/clm5_mode.jl
@@ -0,0 +1,11 @@
+@testset "CLM5 Mode" begin
+    FT = Float64;
+    wls = WaveLengths{FT}(maxwlPAR = 750);
+    node = SoilPlantAirContinuum.SPACMono{FT}(wl_set = wls);
+    for leaf in node.leaves_rt
+        leaf.prescribe = true;
+    end;
+    node.soil_opt.hyperspectral = false;
+    SoilPlantAirContinuum.initialize_spac_canopy!(node);
+    @test true;
+end;
diff --git a/test/modules/CanopyLayers.jl b/test/modules/CanopyLayers.jl
new file mode 100644
index 00000000..959acea1
--- /dev/null
+++ b/test/modules/CanopyLayers.jl
@@ -0,0 +1,101 @@
+@testset verbose = true "CanopyLayers" begin
+    @testset "SCOPE model" begin
+        for FT in [Float32, Float64]
+            collections = initialize_rt_module(FT; nLayer=20, LAI=3);
+            angles, can, can_opt, can_rad, in_rad, leaves, rt_con, rt_dim, soil, wls = collections;
+            for data_set in collections
+                @test PkgUtility.FT_test(data_set, FT);
+                @test PkgUtility.NaN_test(data_set);
+            end;
+
+            # add more tests
+            angles.sza = 30;
+            angles.raa = 0;
+            can.LAI    = 3;
+            VZA        = collect(FT, -89.5:0.5:89.5);
+            for VZA_ in VZA
+                angles.vza = VZA_;
+                canopy_geometry!(can, angles, can_opt, rt_con);
+                canopy_matrices!(leaves, can_opt);
+                short_wave!(can, can_opt, can_rad, in_rad, soil, rt_con);
+                SIF_fluxes!(leaves, can_opt, can_rad, can, soil, wls, rt_con, rt_dim);
+            end;
+            @test true;
+
+            angles.sza = 48;
+            angles.raa = 0;
+            can.LAI    = FT(3.22);
+            for raa in 0:5:360
+                angles.raa = raa;
+                for VZA in 0:5:85
+                    angles.vza = VZA;
+                    canopy_geometry!(can, angles, can_opt, rt_con);
+                    canopy_matrices!(leaves, can_opt);
+                    short_wave!(can, can_opt, can_rad, in_rad, soil, rt_con);
+                    SIF_fluxes!(leaves, can_opt, can_rad, can, soil, wls, rt_con, rt_dim);
+                end;
+            end;
+            @test true;
+
+            # add more tests that has not been used
+            can.clump_a = 0.6;
+            can.clump_b = 0.1;
+            CanopyLayers.clumping_factor!(can, angles);
+            canopy_fluxes!(can, can_opt, can_rad, in_rad, soil, leaves[1:1], wls, rt_con);
+            canopy_matrices!(leaves[1:1], can_opt);
+            SIF_fluxes!(leaves[1:1], can_opt, can_rad, can, soil, wls, rt_con, rt_dim);
+            thermal_fluxes!(leaves[1:1], can_opt, can_rad, can, soil, [FT(400)], wls);
+            thermal_fluxes!(leaves[1:2], can_opt, can_rad, can, soil, [FT(400)], wls);
+            @test true;
+
+            # utility functions
+            CanopyLayers.dcum(FT(1.1), FT(1.1), FT(1.1));
+            CanopyLayers.e2phot(rand(FT,10), rand(FT,10));
+            CanopyLayers.volscatt!(rand(FT,4), FT(40), FT(90), FT(40), FT(0));
+            @test true;
+        end;
+    end;
+
+    @testset "Remote sensing indicies" begin
+        for FT in [Float32, Float64]
+            collections = initialize_rt_module(FT; nLayer=20, LAI=3);
+            angles, can, can_opt, can_rad, in_rad, leaves, rt_con, rt_dim, soil, wls = collections;
+            _indices = [EVI(can_rad, wls),
+                        EVI2(can_rad, wls),
+                        LSWI(can_rad, wls),
+                        NDVI(can_rad, wls),
+                        NIRv(can_rad, wls),
+                        NIRvES(can_rad, wls),
+                        SIF_740(can_rad, wls),
+                        SIF_757(can_rad, wls),
+                        SIF_771(can_rad, wls)];
+            @test PkgUtility.NaN_test(_indices);
+            @test PkgUtility.FT_test(_indices, FT);
+        end;
+    end;
+
+    @testset "Soil albedo" begin
+        for FT in [Float32, Float64]
+            collections = initialize_rt_module(FT; nLayer=20, LAI=3);
+            angles, can, can_opt, can_rad, in_rad, leaves, rt_con, rt_dim, soil, wls = collections;
+            _4p = CanopyLayers.FourBandsFittingPoint();
+            _4c = CanopyLayers.FourBandsFittingCurve();
+            _4h = CanopyLayers.FourBandsFittingHybrid();
+            for _method in [_4p, _4c, _4h]
+                CanopyLayers.fit_soil_mat!(soil, wls, FT(0.5), _method; clm=false);
+                @test true;
+                CanopyLayers.fit_soil_mat!(soil, wls, FT(0.5), _method; clm=true);
+                @test true;
+            end;
+        end;
+    end;
+
+    @testset "Switch among land spectra sets" begin
+        for FT in [Float32, Float64]
+            collections = initialize_rt_module(FT; nLayer=20, LAI=3);
+            @test true;
+            collections = initialize_rt_module(FT; nLayer=20, LAI=3, opti_file=CanopyLayers.LAND_2017);
+            @test true;
+        end;
+    end;
+end;
diff --git a/test/modules/Photosynthesis.jl b/test/modules/Photosynthesis.jl
new file mode 100644
index 00000000..0080e137
--- /dev/null
+++ b/test/modules/Photosynthesis.jl
@@ -0,0 +1,95 @@
+@testset verbose = true "Photosynthesis" begin
+    @testset "Structures" begin
+        for FT in [Float32, Float64]
+            for data_set in [ Photosynthesis.KcTDBernacchi(FT),
+                              Photosynthesis.VpmaxTDBoyd(FT),
+                              C3CLM(FT),
+                              C4CLM(FT),
+                              AirLayer{FT}(),
+                              Leaf{FT}(),
+                              Photosynthesis.FluorescenceVanDerTol(FT),
+                              Photosynthesis.FluorescenceVanDerTolDrought(FT),
+                              Photosynthesis.KoTDBernacchi(FT),
+                              Photosynthesis.RespirationTDBernacchi(FT),
+                              Photosynthesis.VcmaxTDBernacchi(FT),
+                              Photosynthesis.VomaxTDBernacchi(FT),
+                              Photosynthesis.ΓStarTDBernacchi(FT),
+                              Photosynthesis.KpepTDBoyd(FT),
+                              Photosynthesis.JmaxTDLeuning(FT),
+                              Photosynthesis.VcmaxTDLeuning(FT),
+                              Photosynthesis.JmaxTDBernacchi(FT),
+                              Photosynthesis.VtoRCollatz(FT),
+                              C3Bernacchi(FT),
+                              Photosynthesis.Q10TDAngiosperm(FT),
+                              Photosynthesis.Q10TDGymnosperm(FT) ]
+                @test PkgUtility.FT_test(data_set, FT);
+                @test PkgUtility.NaN_test(data_set);
+            end;
+        end;
+    end;
+
+    @testset "Key functions" begin
+        for FT in [Float32, Float64]
+            c3_set   = C3CLM(FT);
+            c4_set   = C4CLM(FT);
+            leaf_3   = Leaf{FT}();
+            leaf_4   = Leaf{FT}();
+            td_q10   = Photosynthesis.Q10TD{FT}(1, 273.15, 1.7);
+            envir    = AirLayer{FT}();
+            fluo_set = c3_set.Flu;
+            T        = rand(FT) + 298;
+            glc      = FT(0.1);
+            p_i      = rand(FT) + 20;
+
+            # temperature corrections
+            Photosynthesis.photo_TD_from_set(td_q10, T);
+            leaf_temperature_dependence!(c3_set, leaf_3, envir, T);
+            leaf_temperature_dependence!(c4_set, leaf_4, envir, T);
+
+            # rubisco limited rates
+            Photosynthesis.rubisco_limited_rate!(c3_set, leaf_3);
+            Photosynthesis.rubisco_limited_rate!(c4_set, leaf_4);
+            @test PkgUtility.NaN_test(leaf_3);
+            @test PkgUtility.NaN_test(leaf_4);
+            Photosynthesis.rubisco_limited_rate!(c3_set, leaf_3, envir);
+            @test PkgUtility.NaN_test(leaf_3);
+
+            # light limited rates
+            Photosynthesis.leaf_ETR!(c3_set, leaf_3);
+            Photosynthesis.leaf_ETR!(c4_set, leaf_4);
+            Photosynthesis.light_limited_rate!(c3_set, leaf_3);
+            Photosynthesis.light_limited_rate!(c4_set, leaf_4);
+            @test PkgUtility.NaN_test(leaf_3);
+            @test PkgUtility.NaN_test(leaf_4);
+            Photosynthesis.light_limited_rate!(c3_set, leaf_3, envir);
+            @test PkgUtility.NaN_test(leaf_3);
+
+            # product limited rates
+            Photosynthesis.product_limited_rate!(c3_set, leaf_3);
+            Photosynthesis.product_limited_rate!(c4_set, leaf_4);
+            @test PkgUtility.NaN_test(leaf_3);
+            @test PkgUtility.NaN_test(leaf_4);
+            Photosynthesis.product_limited_rate!(c4_set, leaf_4, envir);
+            @test PkgUtility.NaN_test(leaf_4);
+
+            # fluorescence
+            leaf_photosynthesis!(c3_set, leaf_3, envir, PCO₂Mode(), FT(2));
+            leaf_fluorescence!(fluo_set, leaf_3);
+            leaf_photosynthesis!(c3_set, leaf_3, envir, GCO₂Mode());
+            leaf_fluorescence!(fluo_set, leaf_3);
+            @test PkgUtility.NaN_test(leaf_3);
+
+            # leaf photo from glc
+            leaf_photosynthesis!(c3_set, leaf_3, envir, GCO₂Mode(), glc);
+            leaf_photosynthesis!(c4_set, leaf_4, envir, GCO₂Mode(), glc);
+            @test PkgUtility.NaN_test(leaf_3);
+            @test PkgUtility.NaN_test(leaf_4);
+
+            # leaf photo from p_i
+            leaf_photosynthesis!(c3_set, leaf_3, envir, PCO₂Mode(), p_i);
+            leaf_photosynthesis!(c4_set, leaf_4, envir, PCO₂Mode(), p_i);
+            @test PkgUtility.NaN_test(leaf_3);
+            @test PkgUtility.NaN_test(leaf_4);
+        end;
+    end;
+end;
diff --git a/test/modules/PlantHydraulics.jl b/test/modules/PlantHydraulics.jl
new file mode 100644
index 00000000..2c30f448
--- /dev/null
+++ b/test/modules/PlantHydraulics.jl
@@ -0,0 +1,304 @@
+@testset verbose = true "PlantHydraulics" begin
+    @testset "Structures" begin
+        for FT in [Float32, Float64]
+            leaf  = LeafHydraulics{FT}();
+            root  = RootHydraulics{FT}();
+            stem  = StemHydraulics{FT}();
+            grass = create_grass(FT(-2.1), FT(0.5), FT[0,-1,-2,-3], collect(FT,0:1:20));
+            palm  = create_palm(FT(-2.1), FT(5.5), FT(6), FT[0,-1,-2,-3], collect(FT,0:1:20));
+            tree  = create_tree(FT(-2.1), FT(5.5), FT(6), FT[0,-1,-2,-3], collect(FT,0:1:20));
+            treet = TreeSimple{FT}();
+            _vc1  = WeibullSingle{FT}();
+            _vc2  = WeibullDual{FT}();
+            _sh1  = BrooksCorey{FT}();
+            _sh2  = VanGenuchten{FT}();
+
+            # Test the struct
+            for data_set in [ leaf, root, stem, grass, palm, tree, treet, _vc1, _vc2, _sh1, _sh2]
+                @test PkgUtility.FT_test(data_set, FT)
+                @test PkgUtility.NaN_test(data_set)
+            end;
+
+            # Test Soil types
+            _nams = ["Sand", "Loamy Sand", "Sandy Loam", "Loam", "Sandy Clay Loam",
+                     "Silt Loam", "Silt", "Clay Loam", "Silty Clay Loam",
+                     "Sandy Clay", "Silty Clay", "Clay"];
+            for _name in _nams
+                create_soil_VC(_sh1, _name);
+                create_soil_VC(_sh2, _name);
+            end;
+        end;
+    end;
+
+    @testset "Soil VC" begin
+        for FT in [Float32, Float64]
+            _sh1  = BrooksCorey{FT}();
+            _sh2  = VanGenuchten{FT}();
+
+            # test soil functions
+            _rwc = FT(0.5);
+            _p   = FT(-0.5);
+            for result in [ soil_erwc(_sh2, FT(1)),
+                            soil_rwc(_sh1, _p),
+                            soil_rwc(_sh2, _p),
+                            soil_k_ratio_rwc(_sh1, _rwc),
+                            soil_k_ratio_rwc(_sh2, _rwc),
+                            soil_k_ratio_swc(_sh1, _rwc*_sh1.Θs),
+                            soil_k_ratio_swc(_sh2, _rwc*_sh2.Θs),
+                            soil_k_ratio_p25(_sh1, _p),
+                            soil_k_ratio_p25(_sh2, _p),
+                            soil_p_25_erwc(_sh1, FT(1)),
+                            soil_p_25_erwc(_sh2, FT(1)),
+                            soil_p_25_rwc(_sh1, _rwc),
+                            soil_p_25_rwc(_sh2, _rwc),
+                            soil_p_25_swc(_sh1, _rwc*_sh1.Θs),
+                            soil_p_25_swc(_sh2, _rwc*_sh2.Θs) ]
+                @test PkgUtility.FT_test(result, FT);
+                @test PkgUtility.NaN_test(result);
+            end;
+
+            # test if the soil_p_25 and soil_rwc converge
+            _p_giv = FT(-2);
+            _r_m_1 = soil_erwc(_sh1, _p_giv);
+            _r_m_2 = soil_erwc(_sh2, _p_giv);
+            _p_m_1 = soil_p_25_erwc(_sh1, _r_m_1);
+            _p_m_2 = soil_p_25_erwc(_sh2, _r_m_2);
+            @test _p_giv ≈ _p_m_1 ≈ _p_m_2;
+
+            _r_m_1 = soil_rwc(_sh1, _p_giv);
+            _r_m_2 = soil_rwc(_sh2, _p_giv);
+            _p_m_1 = soil_p_25_rwc(_sh1, _r_m_1);
+            _p_m_2 = soil_p_25_rwc(_sh2, _r_m_2);
+            @test _p_giv ≈ _p_m_1 ≈ _p_m_2;
+
+            _r_m_1 = soil_swc(_sh1, _p_giv);
+            _r_m_2 = soil_swc(_sh2, _p_giv);
+            _p_m_1 = soil_p_25_swc(_sh1, _r_m_1);
+            _p_m_2 = soil_p_25_swc(_sh2, _r_m_2);
+            @test _p_giv ≈ _p_m_1 ≈ _p_m_2;
+        end;
+    end;
+
+    @testset "Xylem VC" begin
+        for FT in [Float32, Float64]
+            _vc1 = WeibullSingle{FT}();
+            _vc2 = WeibullDual{FT}();
+            _sh1 = BrooksCorey{FT}();
+            _sh2 = VanGenuchten{FT}();
+            _p   = FT(-0.5);
+            _v   = FT(0.9);
+
+            # Test xylem_p_crit
+            f_st = FT(1)
+            for result in [ xylem_p_crit(_vc1, f_st),
+                            xylem_p_crit(_vc2, f_st) ]
+                @test PkgUtility.FT_test(result, FT);
+                @test PkgUtility.NaN_test(result);
+            end;
+
+            # test the xylem_k_ratio
+            for result in [ xylem_k_ratio(_vc1, _p, _v),
+                            xylem_k_ratio(_vc2, _p, _v),
+                            xylem_k_ratio(_vc1, FT(1), _v),
+                            xylem_k_ratio(_vc2, FT(1), _v) ]
+                @test PkgUtility.FT_test(result, FT);
+                @test PkgUtility.NaN_test(result);
+            end;
+        end;
+    end;
+
+    @testset "Leaf" begin
+        for FT in [Float32, Float64]
+            leaf  = LeafHydraulics{FT}();
+            _f    = FT(0.01);
+
+            # Test the struct
+            _lr = xylem_risk(leaf, _f);
+            _ec = critical_flow(leaf);
+
+            for result in [_lr, _ec]
+                @test PkgUtility.FT_test(result, FT);
+                @test PkgUtility.NaN_test(result);
+            end;
+        end;
+    end;
+
+    @testset "Legacy" begin
+        for FT in [Float32, Float64]
+            _ps   = FT(-0.1);
+            _ft   = FT(1);
+            _fsl  = FT(0.8);
+            _fsh  = FT(0.2);
+            _rsl  = FT(0.5);
+
+            # Test the struct
+            grass = create_grass(FT(-2.1), FT(0.5), FT[0,-1,-2,-3], collect(FT,0:1:20));
+            palm  = create_palm(FT(-2.1), FT(5.5), FT(6), FT[0,-1,-2,-3], collect(FT,0:1:20));
+            tree  = create_tree(FT(-2.1), FT(5.5), FT(6), FT[0,-1,-2,-3], collect(FT,0:1:20));
+            treet = TreeSimple{FT}();
+            pressure_profile!(treet, _ps, _ft);
+            @test PkgUtility.FT_test(treet, FT);
+            @test PkgUtility.NaN_test(treet);
+
+            treet = TreeSimple{FT}();
+            pressure_profile!(treet, _ps, _fsl, _fsh, _rsl);
+            @test PkgUtility.FT_test(treet, FT);
+            @test PkgUtility.NaN_test(treet);
+
+            for _plant in [grass, palm, tree]
+                flow_profile!(_plant);
+                pressure_profile!(_plant, SteadyStateMode(); update=true);
+                @test PkgUtility.FT_test(_plant, FT);
+                @test PkgUtility.NaN_test(_plant);
+            end;
+
+            inititialize_legacy!(grass);
+            inititialize_legacy!(palm);
+            inititialize_legacy!(tree);
+            inititialize_legacy!(treet);
+            @test PkgUtility.FT_test(treet, FT);
+            @test PkgUtility.NaN_test(treet);
+        end;
+    end;
+
+    @testset "Temperature functions" begin
+        for FT in [Float32, Float64]
+            leaf  = LeafHydraulics{FT}();
+            root  = RootHydraulics{FT}();
+            treet = TreeSimple{FT}();
+            grass = create_grass(FT(-2.1), FT(0.5), FT[0,-1,-2,-3], collect(FT,0:1:20));
+            palm  = create_palm(FT(-2.1), FT(5.5), FT(6), FT[0,-1,-2,-3], collect(FT,0:1:20));
+            tree  = create_tree(FT(-2.1), FT(5.5), FT(6), FT[0,-1,-2,-3], collect(FT,0:1:20));
+            T     = rand(FT) + 298;
+
+            # test the temperature functions
+            temperature_effects!(treet);
+            temperature_effects!(grass);
+            temperature_effects!(palm );
+            temperature_effects!(tree );
+            temperature_effects!(leaf, T);
+            temperature_effects!(root, T);
+
+            for dataset in [leaf, root, treet, grass, palm, tree]
+                @test PkgUtility.FT_test(dataset, FT);
+                @test PkgUtility.NaN_test(dataset);
+            end;
+        end;
+    end;
+
+    @testset "Root-related functions" begin
+        for FT in [Float32, Float64]
+            root  = RootHydraulics{FT}();
+            grass = create_grass(FT(-2.1), FT(0.5), collect(FT,0:-0.5:-3.0), collect(FT,0:1:20));
+
+            # test the root q functions
+            _p1 = FT(0)
+            _p2 = FT(-0.5)
+            _p3 = FT(-1.0)
+            for result in [ xylem_flow(root, _p1),
+                            xylem_flow(root, _p2),
+                            xylem_flow(root, _p3) ]
+                @test PkgUtility.FT_test(result, FT);
+                @test PkgUtility.NaN_test(result);
+            end;
+
+            # test the root qs from q functions
+            _f0 = FT(0);
+            _f1 = FT(0.1);
+            _f2 = FT(0.5);
+            _ks = zeros(FT, 5);
+            _ps = zeros(FT, 5);
+            _qs = zeros(FT, 5);
+            for _f in [_f0, _f1, _f2]
+                roots_flow!(grass.roots, _ks, _ps, _qs, _f);
+                @test PkgUtility.FT_test(grass, FT);
+                @test PkgUtility.NaN_test(grass);
+            end;
+
+            # test the recalculate_roots_flow function
+            _ks = zeros(FT, 5);
+            _ps = zeros(FT, 5);
+            _qs = zeros(FT, 5);
+            roots_flow!(grass.roots, _ks, _ps, _qs, FT(0.5));
+            roots_flow!(grass, FT(0.5));
+            @test PkgUtility.NaN_test(grass);
+        end;
+    end;
+
+    @testset "Pressure functions" begin
+        for FT in [Float32, Float64]
+            leaf  = LeafHydraulics{FT}();
+            root  = RootHydraulics{FT}();
+            stem  = StemHydraulics{FT}();
+            grass = create_grass(FT(-2.1), FT(0.5), FT[0,-1,-2,-3], collect(FT,0:1:20));
+            palm  = create_palm(FT(-2.1), FT(5.5), FT(6), FT[0,-1,-2,-3], collect(FT,0:1:20));
+            tree  = create_tree(FT(-2.1), FT(5.5), FT(6), FT[0,-1,-2,-3], collect(FT,0:1:20));
+            treet = TreeSimple{FT}();
+
+            # test the end_pressure function
+            _f_1 = FT(0.001)
+            _f_2 = FT(1)
+            for result in [ end_pressure(leaf, _f_1),
+                            end_pressure(leaf, _f_2),
+                            end_pressure(root, _f_1),
+                            end_pressure(root, _f_2),
+                            end_pressure(stem, _f_1),
+                            end_pressure(stem, _f_2) ]
+                @test PkgUtility.FT_test(result, FT);
+                @test PkgUtility.NaN_test(result);
+            end;
+
+            # test the end_pressure function for plants
+            for result in [ end_pressure(treet, _f_1),
+                            end_pressure(treet, _f_2),
+                            end_pressure(treet, _f_1, _f_1, FT(0.5)) ]
+                @test PkgUtility.FT_test(result, FT);
+                @test PkgUtility.NaN_test(result);
+            end;
+        end;
+    end;
+
+    @testset "Plant level" begin
+        for FT in [Float32, Float64]
+            grass = create_grass(FT(-2.1), FT(0.5), FT[0,-1,-2,-3], collect(FT,0:1:20));
+            palm  = create_palm(FT(-2.1), FT(5.5), FT(6), FT[0,-1,-2,-3], collect(FT,0:1:20));
+            tree  = create_tree(FT(-2.1), FT(5.5), FT(6), FT[0,-1,-2,-3], collect(FT,0:1:20));
+            treet = TreeSimple{FT}();
+
+            # test the critical_flow function
+            for result in [ critical_flow(treet) ]
+                @test PkgUtility.FT_test(result, FT);
+                @test PkgUtility.NaN_test(result);
+            end;
+
+            # test the plant conductances
+            plant_conductances!(treet);
+        end;
+    end;
+
+    @testset "Capacitance" begin
+        for FT in [Float32, Float64]
+            grass = create_grass(FT(-2.1), FT(0.5), FT[0,-1,-2,-3], collect(FT,0:1:20));
+            palm  = create_palm(FT(-2.1), FT(5.4), FT(8), FT[0,-1,-2,-3], collect(FT,0:1:20));
+            tree  = create_tree(FT(-2.1), FT(5.4), FT(8), FT[0,-1,-2,-3], collect(FT,0:1:20));
+
+            # test the critical_flow function
+            update_PVF!(grass, FT(1)); @test true;
+            update_PVF!(palm , FT(1)); @test true;
+            update_PVF!(tree , FT(1)); @test true;
+            for leaf in tree.leaves
+                leaf.q_out = 2e-3;
+            end
+            update_PVF!(tree , FT(1)); @test true;
+            update_PVF!(tree.roots[1], FT(1e6));
+            update_PVF!(tree.roots[1], FT(1e6), true);
+            update_PVF!(tree.trunk, FT(1e6));
+            update_PVF!(tree.leaves[1], FT(1e6));
+
+            # extra tests
+            p_from_volume(PVCurveSegmented{FT}(), FT(0.9), FT(300));
+            p_from_volume(PVCurveSegmented{FT}(), FT(0.6), FT(300));
+            p_from_volume(PVCurveSegmented{FT}(), FT(0.1), FT(300));
+        end;
+    end;
+end;
diff --git a/test/modules/SPAC.jl b/test/modules/SPAC.jl
new file mode 100644
index 00000000..5d229f19
--- /dev/null
+++ b/test/modules/SPAC.jl
@@ -0,0 +1,72 @@
+@testset verbose = true "SoilPlantAirContinuum" begin
+    @testset "Atmosheric pressure" begin
+        for FT in [Float32, Float64]
+            h = FT(1000);
+
+            for result in [ SoilPlantAirContinuum.atmospheric_pressure(h),
+                            SoilPlantAirContinuum.atmospheric_pressure_ratio(h),
+                            SoilPlantAirContinuum.ppm_to_Pa(h) ]
+                @test PkgUtility.FT_test(result, FT);
+                @test PkgUtility.NaN_test(result);
+            end;
+        end;
+    end;
+
+    @testset "Solar zenith_angle" begin
+        for FT in [Float32, Float64]
+            latd = FT(10);
+            decd = FT(10);
+            lhad = FT(10);
+            day  = FT(100);
+            hour = FT(13);
+            minu = FT(30);
+
+            for result in [ SoilPlantAirContinuum.zenith_angle(latd, decd, lhad),
+                            SoilPlantAirContinuum.zenith_angle(latd, day, hour),
+                            SoilPlantAirContinuum.zenith_angle(latd, day, hour, minu) ]
+                @test PkgUtility.FT_test(result, FT);
+                @test PkgUtility.NaN_test(result);
+            end;
+        end;
+    end;
+
+    @testset "Vary SPAC parameters!" begin
+        for FT in [Float32, Float64]
+            node = SoilPlantAirContinuum.SPACMono{FT}();
+            SoilPlantAirContinuum.initialize_spac_canopy!(node);
+            SoilPlantAirContinuum.layer_fluxes!(node);
+            SoilPlantAirContinuum.layer_fluxes!(node, FT(30));
+            @test PkgUtility.NaN_test(node);
+
+            SoilPlantAirContinuum.update_Cab!(node, FT(30));
+            SoilPlantAirContinuum.update_Kmax!(node, FT(1));
+            SoilPlantAirContinuum.update_LAI!(node, FT(3));
+            SoilPlantAirContinuum.update_VJR!(node, FT(0.5));
+            SoilPlantAirContinuum.update_VJRWW!(node, FT(50));
+            SoilPlantAirContinuum.update_Weibull!(node, FT(3));
+            SoilPlantAirContinuum.update_Weibull!(node, FT(3), FT(0.9));
+            @test true;
+        end;
+    end;
+
+    @testset "Switch among land spectra sets" begin
+        for FT in [Float32, Float64]
+            node = SoilPlantAirContinuum.SPACMono{FT}();
+            SoilPlantAirContinuum.initialize_spac_canopy!(node);
+            SoilPlantAirContinuum.layer_fluxes!(node);
+            SoilPlantAirContinuum.layer_fluxes!(node, FT(30));
+            ags = SoilPlantAirContinuum.A_GROSS(node);
+            @test PkgUtility.NaN_test(ags);
+            @test PkgUtility.NaN_test(node);
+            @test true;
+            node = SoilPlantAirContinuum.SPACMono{FT}(opti_file=CanopyLayers.LAND_2017);
+            SoilPlantAirContinuum.initialize_spac_canopy!(node);
+            SoilPlantAirContinuum.layer_fluxes!(node);
+            SoilPlantAirContinuum.layer_fluxes!(node, FT(30));
+            ags = SoilPlantAirContinuum.A_GROSS(node);
+            @test PkgUtility.NaN_test(ags);
+            @test PkgUtility.NaN_test(node);
+            @test true;
+        end;
+    end;
+end;
diff --git a/test/modules/StomataModels.jl b/test/modules/StomataModels.jl
new file mode 100644
index 00000000..f5787ad6
--- /dev/null
+++ b/test/modules/StomataModels.jl
@@ -0,0 +1,228 @@
+@testset verbose = true "StomtaModels" begin
+    @testset "Structures" begin
+        for FT in [Float32, Float64]
+            can_3 = CanopyLayer{FT}(n_leaf=2);
+            esm_1 = ESMBallBerry{FT}();
+            esm_2 = ESMGentine{FT}();
+            esm_3 = ESMLeuning{FT}();
+            esm_4 = ESMMedlyn{FT}();
+            osm_1 = OSMEller{FT}();
+            osm_2 = OSMSperry{FT}();
+            osm_3 = OSMWang{FT}();
+            osm_4 = OSMWAP{FT}();
+            osm_5 = OSMWAPMod{FT}();
+
+            # test the structures
+            for result in [ can_3, esm_1, esm_2, esm_3, esm_4, osm_4, osm_5 ]
+                @test PkgUtility.FT_test(result, FT);
+                @test PkgUtility.NaN_test(result);
+            end;
+        end;
+    end;
+
+    @testset "Gas exchange functions" begin
+        for FT in [Float32, Float64]
+            envir  = AirLayer{FT}();
+            leaf_3 = Leaf{FT}();
+            leaf_4 = Leaf{FT}();
+            mod_3  = C3CLM(FT);
+            mod_4  = C4CLM(FT);
+            rand_T = rand(FT) + 298;
+            can_3  = CanopyLayer{FT}(n_leaf=2);
+            can_4  = CanopyLayer{FT}(n_leaf=2);
+            esm_1  = ESMBallBerry{FT}();
+            esm_2  = ESMGentine{FT}();
+            esm_3  = ESMLeuning{FT}();
+            esm_4  = ESMMedlyn{FT}();
+            osm_1  = OSMEller{FT}();
+            osm_2  = OSMSperry{FT}();
+            osm_3  = OSMWang{FT}();
+            osm_4  = OSMWAP{FT}();
+            osm_5  = OSMWAPMod{FT}();
+            hs     = LeafHydraulics{FT}();
+
+            # test the refresh functions
+            update_leaf_TP!(mod_3, can_3, hs, envir);
+            update_leaf_TP!(mod_4, can_4, hs, envir);
+            @test PkgUtility.NaN_test(can_3);
+            @test PkgUtility.NaN_test(can_4);
+
+            update_leaf_AK!(mod_3, can_3, hs, envir);
+            update_leaf_AK!(mod_4, can_4, hs, envir);
+            @test PkgUtility.NaN_test(can_3);
+            @test PkgUtility.NaN_test(can_4);
+
+            gas_exchange!(mod_3, can_3, envir, GlcDrive(), 1, FT(0.1));
+            gas_exchange!(mod_4, can_4, envir, GlcDrive(), 1, FT(0.1));
+            @test PkgUtility.NaN_test(can_3);
+            @test PkgUtility.NaN_test(can_4);
+
+            gas_exchange!(mod_3, can_3, envir, GswDrive(), 1, FT(0.05));
+            gas_exchange!(mod_4, can_4, envir, GswDrive(), 1, FT(0.05));
+            @test PkgUtility.NaN_test(can_3);
+            @test PkgUtility.NaN_test(can_4);
+
+            can_3.g_sw[2] = 0;
+            can_4.g_sw[2] = 0;
+            gsw_control!(mod_3, can_3, envir, 2);
+            gsw_control!(mod_4, can_4, envir, 2);
+            @test PkgUtility.NaN_test(can_3);
+            @test PkgUtility.NaN_test(can_4);
+        end;
+    end;
+
+    @testset "Empirical formulations" begin
+        for FT in [Float32, Float64]
+            envir  = AirLayer{FT}();
+            leaf_3 = Leaf{FT}();
+            leaf_4 = Leaf{FT}();
+            mod_3  = C3CLM(FT);
+            mod_4  = C4CLM(FT);
+            rand_T = rand(FT) + 298;
+            can_3  = CanopyLayer{FT}(n_leaf=2);
+            can_4  = CanopyLayer{FT}(n_leaf=2);
+            esm_1  = ESMBallBerry{FT}();
+            esm_2  = ESMGentine{FT}();
+            esm_3  = ESMLeuning{FT}();
+            esm_4  = ESMMedlyn{FT}();
+            osm_1  = OSMEller{FT}();
+            osm_2  = OSMSperry{FT}();
+            osm_3  = OSMWang{FT}();
+            osm_4  = OSMWAP{FT}();
+            osm_5  = OSMWAPMod{FT}();
+            hs     = LeafHydraulics{FT}();
+
+            # test the empirical model formulations
+            for result in [ stomatal_conductance(esm_1, leaf_3, envir, FT(1)),
+                            stomatal_conductance(esm_2, leaf_3, envir, FT(1)),
+                            stomatal_conductance(esm_3, leaf_3, envir, FT(1)),
+                            stomatal_conductance(esm_4, leaf_3, envir, FT(1)),
+                            stomatal_conductance(esm_1, can_3, envir, FT(1)),
+                            stomatal_conductance(esm_2, can_3, envir, FT(1)),
+                            stomatal_conductance(esm_3, can_3, envir, FT(1)),
+                            stomatal_conductance(esm_4, can_3, envir, FT(1)),
+                            stomatal_conductance(esm_1, can_3, envir, FT(1), 1),
+                            stomatal_conductance(esm_2, can_3, envir, FT(1), 1),
+                            stomatal_conductance(esm_3, can_3, envir, FT(1), 1),
+                            stomatal_conductance(esm_4, can_3, envir, FT(1), 1) ]
+                @test PkgUtility.FT_test(result, FT);
+                @test PkgUtility.NaN_test(result);
+            end;
+        end;
+    end;
+
+    @testset "Stomatal models" begin
+        for FT in [Float32, Float64]
+            envir  = AirLayer{FT}();
+            leaf_3 = Leaf{FT}();
+            leaf_4 = Leaf{FT}();
+            mod_3  = C3CLM(FT);
+            mod_4  = C4CLM(FT);
+            rand_T = rand(FT) + 298;
+            can_3  = CanopyLayer{FT}(n_leaf=2);
+            can_4  = CanopyLayer{FT}(n_leaf=2);
+            esm_1  = ESMBallBerry{FT}();
+            esm_2  = ESMGentine{FT}();
+            esm_3  = ESMLeuning{FT}();
+            esm_4  = ESMMedlyn{FT}();
+            osm_1  = OSMEller{FT}();
+            osm_2  = OSMSperry{FT}();
+            osm_3  = OSMWang{FT}();
+            osm_4  = OSMWAP{FT}();
+            osm_5  = OSMWAPMod{FT}();
+            hs     = LeafHydraulics{FT}();
+            svc    = VanGenuchten{FT}();
+
+            # test the solution functions
+            for (mod,can) in zip([mod_3, mod_4], [can_3, can_4])
+                for sm in [esm_1, esm_2, esm_3, esm_4]
+                    for result in [ solution_diff!(FT(0.1), mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearPleaf{FT}(), GlcDrive(), 1),
+                                    solution_diff!(FT(0.1), mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearPsoil{FT}(), GlcDrive(), 1),
+                                    solution_diff!(FT(0.1), mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearSWC{FT}(), GlcDrive(), 1),
+                                    solution_diff!(FT(0.1), mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearPleaf{FT}(), GlcDrive(), 1),
+                                    solution_diff!(FT(0.1), mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearPsoil{FT}(), GlcDrive(), 1),
+                                    solution_diff!(FT(0.1), mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearSWC{FT}(), GlcDrive(), 1),
+                                    ]
+                        @test PkgUtility.FT_test(result, FT);
+                        @test PkgUtility.NaN_test(result);
+                    end;
+                end;
+                for sm in [osm_1, osm_2, osm_3, osm_4, osm_5]
+                    result = solution_diff!(FT(0.1), mod, can, hs, envir, sm, GlcDrive(), 1);
+                    @test PkgUtility.FT_test(result, FT);
+                    @test PkgUtility.NaN_test(result);
+                end;
+            end;
+
+            # test the stomata solutions
+            for (mod,can) in zip([mod_3, mod_4], [can_3, can_4])
+                for sm in [esm_1, esm_2, esm_3, esm_4]
+                    gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearKleaf{FT}(), 1);
+                    @test PkgUtility.NaN_test(can);
+                    gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearKsoil{FT}(), 1);
+                    @test PkgUtility.NaN_test(can);
+                    gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearPleaf{FT}(), 1);
+                    @test PkgUtility.NaN_test(can);
+                    gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearPsoil{FT}(), 1);
+                    @test PkgUtility.NaN_test(can);
+                    gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearSWC{FT}(), 1);
+                    @test PkgUtility.NaN_test(can);
+                    gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearKleaf{FT}(), 1);
+                    @test PkgUtility.NaN_test(can);
+                    gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearKsoil{FT}(), 1);
+                    @test PkgUtility.NaN_test(can);
+                    gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearPleaf{FT}(), 1);
+                    @test PkgUtility.NaN_test(can);
+                    gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearPsoil{FT}(), 1);
+                    @test PkgUtility.NaN_test(can);
+                    gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearSWC{FT}(), 1);
+                    @test PkgUtility.NaN_test(can);
+                end;
+                for sm in [osm_1, osm_2, osm_3, osm_4, osm_5]
+                    gas_exchange!(mod, can, hs, envir, sm, 1);
+                    @test PkgUtility.NaN_test(can);
+                end;
+                gas_exchange!(mod, can, TreeSimple{FT}(), envir, osm_3);
+                @test PkgUtility.NaN_test(can);
+            end;
+
+            for (mod,can) in zip([mod_3, mod_4], [can_3, can_4])
+                for sm in [esm_1, esm_2, esm_3, esm_4]
+                    gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearKleaf{FT}());
+                    @test PkgUtility.NaN_test(can);
+                    gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearKsoil{FT}());
+                    @test PkgUtility.NaN_test(can);
+                    gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearPleaf{FT}());
+                    @test PkgUtility.NaN_test(can);
+                    gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearPsoil{FT}());
+                    @test PkgUtility.NaN_test(can);
+                    gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearSWC{FT}());
+                    @test PkgUtility.NaN_test(can);
+                    gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearKleaf{FT}());
+                    @test PkgUtility.NaN_test(can);
+                    gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearKsoil{FT}());
+                    @test PkgUtility.NaN_test(can);
+                    gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearPleaf{FT}());
+                    @test PkgUtility.NaN_test(can);
+                    gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearPsoil{FT}());
+                    @test PkgUtility.NaN_test(can);
+                    gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearSWC{FT}());
+                    @test PkgUtility.NaN_test(can);
+                end;
+                for sm in [osm_1, osm_2, osm_3, osm_4, osm_5]
+                    gas_exchange!(mod, can, hs, envir, sm);
+                    @test PkgUtility.NaN_test(can);
+                end;
+            end;
+
+            # test the nighttime stomatal conductance solution for Wang model
+            can_3.APAR[1] = 0;
+            gas_exchange!(mod_3, can_3, hs, envir, osm_3);
+
+            # test the prognostic g_sw functions
+            prognostic_gsw!(can_3, envir, esm_1, FT(1), FT(120));
+            prognostic_gsw!(mod_3, can_3, hs, envir, osm_3, FT(120));
+            @test true;
+        end;
+    end;
+end;
diff --git a/test/runtests.jl b/test/runtests.jl
index 4ed6b9d6..710b65f5 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -4,18 +4,20 @@ using Land.Photosynthesis
 using Land.PlantHydraulics
 using Land.SoilPlantAirContinuum
 using Land.StomataModels
-using Pkg.Artifacts
 using PkgUtility
 using Test
-using TextIO: read_csv
 
 
 ENV["JULIA_LOG_LEVEL"] = "WARN"
 
+@testset verbose = true "CliMA Land v0.1" begin
+    include("modules/CanopyLayers.jl");
+    include("modules/Photosynthesis.jl");
+    include("modules/PlantHydraulics.jl");
+    include("modules/StomataModels.jl");
+    include("modules/SPAC.jl");
+end;
 
-include("test_CanopyLayers.jl"   )
-include("test_Photosynthesis.jl" )
-include("test_PlantHydraulics.jl")
-include("test_StomataModels.jl"  )
-include("test_SPAC.jl"           )
-include("test_Land.jl"           )
+@testset verbose = true "CliMA Land Features" begin
+    include("features/clm5_mode.jl");
+end;
diff --git a/test/test_CanopyLayers.jl b/test/test_CanopyLayers.jl
deleted file mode 100644
index ad12ee81..00000000
--- a/test/test_CanopyLayers.jl
+++ /dev/null
@@ -1,136 +0,0 @@
-# Test big leaf canopy model
-@info "Testing the big leaf model...";
-@testset "CanopyLayers --- big leaf model" begin
-    for FT in [Float32, Float64]
-        for result in [ big_leaf_partition(FT(3.0), FT(30.0), FT(1000.0)),
-                        big_leaf_partition(FT(2.0), FT(30.0), FT(1000.0)),
-                        big_leaf_partition(FT(1.0), FT(30.0), FT(1000.0)) ]
-            @test PkgUtility.FT_test(result, FT);
-            @test PkgUtility.NaN_test(result);
-        end
-    end
-end
-
-
-
-
-# FT and NaN tests
-println();
-@info "Testing the SCOPE model...";
-@testset "CanopyLayers --- SCOPE model" begin
-    for FT in [Float32, Float64]
-        collections = initialize_rt_module(FT; nLayer=20, LAI=3);
-        angles, can, can_opt, can_rad, in_rad, leaves, rt_con, rt_dim, soil, wls = collections;
-        for data_set in collections
-            @test PkgUtility.FT_test(data_set, FT);
-            @test PkgUtility.NaN_test(data_set);
-        end
-
-        # add more tests
-        angles.sza = 30;
-        angles.raa = 0;
-        can.LAI    = 3;
-        VZA        = collect(FT, -89.5:0.5:89.5);
-        for VZA_ in VZA
-            angles.vza = VZA_;
-            canopy_geometry!(can, angles, can_opt, rt_con);
-            canopy_matrices!(leaves, can_opt);
-            short_wave!(can, can_opt, can_rad, in_rad, soil, rt_con);
-            SIF_fluxes!(leaves, can_opt, can_rad, can, soil, wls, rt_con, rt_dim);
-        end
-        @test true;
-
-        angles.sza = 48;
-        angles.raa = 0;
-        can.LAI    = FT(3.22);
-        for raa in 0:5:360
-            angles.raa = raa;
-            for VZA in 0:5:85
-                angles.vza = VZA;
-                canopy_geometry!(can, angles, can_opt, rt_con);
-                canopy_matrices!(leaves, can_opt);
-                short_wave!(can, can_opt, can_rad, in_rad, soil, rt_con);
-                SIF_fluxes!(leaves, can_opt, can_rad, can, soil, wls, rt_con, rt_dim);
-            end
-        end
-        @test true;
-
-        # test warnings
-        @info "Expect warnings here!";
-        warn_wls   = create_wave_length(FT, collect(FT,2100:100:2600));
-        warn_inrad = create_incoming_radiation(warn_wls);
-        @test true;
-
-        # add more tests that has not been used
-        can.clump_a = 0.6;
-        can.clump_b = 0.1;
-        CanopyLayers.clumping_factor!(can, angles);
-        canopy_fluxes!(can, can_opt, can_rad, in_rad, soil, leaves[1:1], wls, rt_con);
-        canopy_matrices!(leaves[1:1], can_opt);
-        SIF_fluxes!(leaves[1:1], can_opt, can_rad, can, soil, wls, rt_con, rt_dim);
-        thermal_fluxes!(leaves[1:1], can_opt, can_rad, can, soil, [FT(400.0)], wls);
-        thermal_fluxes!(leaves[1:2], can_opt, can_rad, can, soil, [FT(400.0)], wls);
-        @test true;
-
-        # utility functions
-        CanopyLayers.dcum(FT(1.1), FT(1.1), FT(1.1));
-        CanopyLayers.e2phot(rand(FT,10), rand(FT,10));
-        CanopyLayers.volscatt!(rand(FT,4), FT(40), FT(90), FT(40), FT(0));
-        @test true;
-    end
-end
-
-
-
-
-# indices test
-println();
-@info "Testing the Indicies...";
-@testset "CanopyLayers --- Indicies" begin
-    for FT in [Float32, Float64]
-        collections = initialize_rt_module(FT; nLayer=20, LAI=3);
-        angles, can, can_opt, can_rad, in_rad, leaves, rt_con, rt_dim, soil, wls = collections;
-        _indices = [EVI(can_rad, wls),
-                    EVI2(can_rad, wls),
-                    LSWI(can_rad, wls),
-                    NDVI(can_rad, wls),
-                    NIRv(can_rad, wls),
-                    NIRvES(can_rad, wls),
-                    SIF_740(can_rad, wls),
-                    SIF_757(can_rad, wls),
-                    SIF_771(can_rad, wls)];
-        @test PkgUtility.NaN_test(_indices);
-        @test PkgUtility.FT_test(_indices, FT);
-
-        # out bounds warnings
-        @info "Expect warnings here!";
-        REF_WL(can_rad, wls, FT(3000));
-        SIF_WL(can_rad, wls, FT(3000));
-        @test true
-    end
-end
-
-
-
-
-# indices test
-println();
-@info "Testing soil albedo...";
-@testset "CanopyLayers --- Soil albedo" begin
-    for FT in [Float32, Float64]
-        collections = initialize_rt_module(FT; nLayer=20, LAI=3);
-        angles, can, can_opt, can_rad, in_rad, leaves, rt_con, rt_dim, soil, wls = collections;
-        _2p = CanopyLayers.TwoBandsFittingPoint();
-        _2c = CanopyLayers.TwoBandsFittingCurve();
-        _2h = CanopyLayers.TwoBandsFittingHybrid();
-        _4p = CanopyLayers.FourBandsFittingPoint();
-        _4c = CanopyLayers.FourBandsFittingCurve();
-        _4h = CanopyLayers.FourBandsFittingHybrid();
-        for _method in [_2p, _2c, _2h, _4p, _4c, _4h]
-            CanopyLayers.fit_soil_mat!(soil, wls, FT(0.5), _method; clm=false);
-            @test true;
-            CanopyLayers.fit_soil_mat!(soil, wls, FT(0.5), _method; clm=true);
-            @test true;
-        end;
-    end
-end
diff --git a/test/test_Land.jl b/test/test_Land.jl
deleted file mode 100644
index 65003e60..00000000
--- a/test/test_Land.jl
+++ /dev/null
@@ -1,5 +0,0 @@
-println("\nTesting the Land ODE functions...");
-@testset "Land --- Land model" begin
-    # initialize parameters
-    @test true;
-end
diff --git a/test/test_Photosynthesis.jl b/test/test_Photosynthesis.jl
deleted file mode 100644
index 58ef6e9c..00000000
--- a/test/test_Photosynthesis.jl
+++ /dev/null
@@ -1,99 +0,0 @@
-# FT and NaN test for the structs
-@testset "Photosynthesis --- structures" begin
-    for FT in [Float32, Float64]
-        for data_set in [ Photosynthesis.KcTDBernacchi(FT),
-                          Photosynthesis.VpmaxTDBoyd(FT),
-                          C3CLM(FT),
-                          C4CLM(FT),
-                          AirLayer{FT}(),
-                          Leaf{FT}(),
-                          Photosynthesis.FluorescenceVanDerTol(FT),
-                          Photosynthesis.FluorescenceVanDerTolDrought(FT),
-                          Photosynthesis.KoTDBernacchi(FT),
-                          Photosynthesis.RespirationTDBernacchi(FT),
-                          Photosynthesis.VcmaxTDBernacchi(FT),
-                          Photosynthesis.VomaxTDBernacchi(FT),
-                          Photosynthesis.ΓStarTDBernacchi(FT),
-                          Photosynthesis.KpepTDBoyd(FT),
-                          Photosynthesis.JmaxTDLeuning(FT),
-                          Photosynthesis.VcmaxTDLeuning(FT),
-                          Photosynthesis.JmaxTDBernacchi(FT),
-                          Photosynthesis.VtoRCollatz(FT),
-                          C3Bernacchi(FT),
-                          Photosynthesis.Q10TDAngiosperm(FT),
-                          Photosynthesis.Q10TDGymnosperm(FT) ]
-            @test PkgUtility.FT_test(data_set, FT);
-            @test PkgUtility.NaN_test(data_set);
-        end
-    end
-end
-
-
-
-
-# FT and NaN test for the structs
-println();
-@testset "Photosynthesis --- functions" begin
-    for FT in [Float32, Float64]
-        c3_set   = C3CLM(FT);
-        c4_set   = C4CLM(FT);
-        leaf_3   = Leaf{FT}();
-        leaf_4   = Leaf{FT}();
-        td_q10   = Photosynthesis.Q10TD{FT}(1, 273.15, 1.7);
-        envir    = AirLayer{FT}();
-        fluo_set = c3_set.Flu;
-        T        = rand(FT) + 298;
-        glc      = FT(0.1);
-        p_i      = rand(FT) + 20;
-
-        # temperature corrections
-        Photosynthesis.photo_TD_from_set(td_q10, T);
-        leaf_temperature_dependence!(c3_set, leaf_3, envir, T);
-        leaf_temperature_dependence!(c4_set, leaf_4, envir, T);
-
-        # rubisco limited rates
-        Photosynthesis.rubisco_limited_rate!(c3_set, leaf_3);
-        Photosynthesis.rubisco_limited_rate!(c4_set, leaf_4);
-        @test PkgUtility.NaN_test(leaf_3);
-        @test PkgUtility.NaN_test(leaf_4);
-        Photosynthesis.rubisco_limited_rate!(c3_set, leaf_3, envir);
-        @test PkgUtility.NaN_test(leaf_3);
-
-        # light limited rates
-        Photosynthesis.leaf_ETR!(c3_set, leaf_3);
-        Photosynthesis.leaf_ETR!(c4_set, leaf_4);
-        Photosynthesis.light_limited_rate!(c3_set, leaf_3);
-        Photosynthesis.light_limited_rate!(c4_set, leaf_4);
-        @test PkgUtility.NaN_test(leaf_3);
-        @test PkgUtility.NaN_test(leaf_4);
-        Photosynthesis.light_limited_rate!(c3_set, leaf_3, envir);
-        @test PkgUtility.NaN_test(leaf_3);
-
-        # product limited rates
-        Photosynthesis.product_limited_rate!(c3_set, leaf_3);
-        Photosynthesis.product_limited_rate!(c4_set, leaf_4);
-        @test PkgUtility.NaN_test(leaf_3);
-        @test PkgUtility.NaN_test(leaf_4);
-        Photosynthesis.product_limited_rate!(c4_set, leaf_4, envir);
-        @test PkgUtility.NaN_test(leaf_4);
-
-        # fluorescence
-        leaf_photosynthesis!(c3_set, leaf_3, envir, PCO₂Mode(), FT(2));
-        leaf_fluorescence!(fluo_set, leaf_3);
-        leaf_photosynthesis!(c3_set, leaf_3, envir, GCO₂Mode());
-        leaf_fluorescence!(fluo_set, leaf_3);
-        @test PkgUtility.NaN_test(leaf_3);
-
-        # leaf photo from glc
-        leaf_photosynthesis!(c3_set, leaf_3, envir, GCO₂Mode(), glc);
-        leaf_photosynthesis!(c4_set, leaf_4, envir, GCO₂Mode(), glc);
-        @test PkgUtility.NaN_test(leaf_3);
-        @test PkgUtility.NaN_test(leaf_4);
-
-        # leaf photo from p_i
-        leaf_photosynthesis!(c3_set, leaf_3, envir, PCO₂Mode(), p_i);
-        leaf_photosynthesis!(c4_set, leaf_4, envir, PCO₂Mode(), p_i);
-        @test PkgUtility.NaN_test(leaf_3);
-        @test PkgUtility.NaN_test(leaf_4);
-    end
-end
diff --git a/test/test_PlantHydraulics.jl b/test/test_PlantHydraulics.jl
deleted file mode 100644
index 1fcd1585..00000000
--- a/test/test_PlantHydraulics.jl
+++ /dev/null
@@ -1,343 +0,0 @@
-# FT and NaN test
-println("\nTesting the structures...")
-@testset "Hydraulics --- structures" begin
-    for FT in [Float32, Float64]
-        leaf  = LeafHydraulics{FT}();
-        root  = RootHydraulics{FT}();
-        stem  = StemHydraulics{FT}();
-        grass = create_grass(FT(-2.1), FT(0.5), FT[0,-1,-2,-3], collect(FT,0:1:20));
-        palm  = create_palm(FT(-2.1), FT(5.5), FT(6), FT[0,-1,-2,-3], collect(FT,0:1:20));
-        tree  = create_tree(FT(-2.1), FT(5.5), FT(6), FT[0,-1,-2,-3], collect(FT,0:1:20));
-        treet = TreeSimple{FT}();
-        _vc1  = WeibullSingle{FT}();
-        _vc2  = WeibullDual{FT}();
-        _sh1  = BrooksCorey{FT}();
-        _sh2  = VanGenuchten{FT}();
-
-        # Test the struct
-        for data_set in [ leaf, root, stem, grass, palm, tree, treet, _vc1, _vc2, _sh1, _sh2]
-            @test PkgUtility.FT_test(data_set, FT)
-            @test PkgUtility.NaN_test(data_set)
-        end
-
-        # Test Soil types
-        _nams = ["Sand", "Loamy Sand", "Sandy Loam", "Loam", "Sandy Clay Loam",
-                 "Silt Loam", "Silt", "Clay Loam", "Silty Clay Loam",
-                 "Sandy Clay", "Silty Clay", "Clay"];
-        for _name in _nams
-            create_soil_VC(_sh1, _name);
-            create_soil_VC(_sh2, _name);
-        end
-        println("Expecting a warning here");
-        create_soil_VC(_sh1, "Other");
-        @test true;
-    end
-end
-
-
-
-# FT and NaN test
-println("\nTesting the soil VC functions...")
-@testset "Hydraulics --- soil VC" begin
-    for FT in [Float32, Float64]
-        _sh1  = BrooksCorey{FT}();
-        _sh2  = VanGenuchten{FT}();
-
-        # test soil functions
-        _rwc = FT(0.5);
-        _p   = FT(-0.5);
-        for result in [ soil_erwc(_sh2, FT(1)),
-                        soil_rwc(_sh1, _p),
-                        soil_rwc(_sh2, _p),
-                        soil_k_ratio_rwc(_sh1, _rwc),
-                        soil_k_ratio_rwc(_sh2, _rwc),
-                        soil_k_ratio_swc(_sh1, _rwc*_sh1.Θs),
-                        soil_k_ratio_swc(_sh2, _rwc*_sh2.Θs),
-                        soil_k_ratio_p25(_sh1, _p),
-                        soil_k_ratio_p25(_sh2, _p),
-                        soil_p_25_erwc(_sh1, FT(1)),
-                        soil_p_25_erwc(_sh2, FT(1)),
-                        soil_p_25_rwc(_sh1, _rwc),
-                        soil_p_25_rwc(_sh2, _rwc),
-                        soil_p_25_swc(_sh1, _rwc*_sh1.Θs),
-                        soil_p_25_swc(_sh2, _rwc*_sh2.Θs) ]
-            @test PkgUtility.FT_test(result, FT);
-            @test PkgUtility.NaN_test(result);
-        end
-
-        # test if the soil_p_25 and soil_rwc converge
-        _p_giv = FT(-2);
-        _r_m_1 = soil_erwc(_sh1, _p_giv);
-        _r_m_2 = soil_erwc(_sh2, _p_giv);
-        _p_m_1 = soil_p_25_erwc(_sh1, _r_m_1);
-        _p_m_2 = soil_p_25_erwc(_sh2, _r_m_2);
-        @test _p_giv ≈ _p_m_1 ≈ _p_m_2;
-
-        _r_m_1 = soil_rwc(_sh1, _p_giv);
-        _r_m_2 = soil_rwc(_sh2, _p_giv);
-        _p_m_1 = soil_p_25_rwc(_sh1, _r_m_1);
-        _p_m_2 = soil_p_25_rwc(_sh2, _r_m_2);
-        @test _p_giv ≈ _p_m_1 ≈ _p_m_2;
-
-        _r_m_1 = soil_swc(_sh1, _p_giv);
-        _r_m_2 = soil_swc(_sh2, _p_giv);
-        _p_m_1 = soil_p_25_swc(_sh1, _r_m_1);
-        _p_m_2 = soil_p_25_swc(_sh2, _r_m_2);
-        @test _p_giv ≈ _p_m_1 ≈ _p_m_2;
-    end
-end
-
-
-
-# FT and NaN test
-println("\nTesting the xylem VC functions...")
-@testset "Hydraulics --- xylem VC" begin
-    for FT in [Float32, Float64]
-        _vc1 = WeibullSingle{FT}();
-        _vc2 = WeibullDual{FT}();
-        _sh1 = BrooksCorey{FT}();
-        _sh2 = VanGenuchten{FT}();
-        _p   = FT(-0.5);
-        _v   = FT(0.9);
-
-        # Test xylem_p_crit
-        f_st = FT(1)
-        for result in [ xylem_p_crit(_vc1, f_st),
-                        xylem_p_crit(_vc2, f_st) ]
-            @test PkgUtility.FT_test(result, FT);
-            @test PkgUtility.NaN_test(result);
-        end
-
-        # test the xylem_k_ratio
-        for result in [ xylem_k_ratio(_vc1, _p, _v),
-                        xylem_k_ratio(_vc2, _p, _v),
-                        xylem_k_ratio(_vc1, FT(1), _v),
-                        xylem_k_ratio(_vc2, FT(1), _v) ]
-            @test PkgUtility.FT_test(result, FT);
-            @test PkgUtility.NaN_test(result);
-        end
-    end
-end
-
-
-
-# FT and NaN test
-println("\nTesting the leaf functions...")
-@testset "Hydraulics --- leaf" begin
-    for FT in [Float32, Float64]
-        leaf  = LeafHydraulics{FT}();
-        _f    = FT(0.01);
-
-        # Test the struct
-        _lr = xylem_risk(leaf, _f);
-        _ec = critical_flow(leaf);
-
-        for result in [_lr, _ec]
-            @test PkgUtility.FT_test(result, FT);
-            @test PkgUtility.NaN_test(result);
-        end
-    end
-end
-
-
-
-# FT and NaN test
-println("\nTesting the legacy functions...")
-@testset "Hydraulics --- legacy" begin
-    for FT in [Float32, Float64]
-        _ps   = FT(-0.1);
-        _ft   = FT(1);
-        _fsl  = FT(0.8);
-        _fsh  = FT(0.2);
-        _rsl  = FT(0.5);
-
-        # Test the struct
-        grass = create_grass(FT(-2.1), FT(0.5), FT[0,-1,-2,-3], collect(FT,0:1:20));
-        palm  = create_palm(FT(-2.1), FT(5.5), FT(6), FT[0,-1,-2,-3], collect(FT,0:1:20));
-        tree  = create_tree(FT(-2.1), FT(5.5), FT(6), FT[0,-1,-2,-3], collect(FT,0:1:20));
-        treet = TreeSimple{FT}();
-        pressure_profile!(treet, _ps, _ft);
-        @test PkgUtility.FT_test(treet, FT);
-        @test PkgUtility.NaN_test(treet);
-
-        treet = TreeSimple{FT}();
-        pressure_profile!(treet, _ps, _fsl, _fsh, _rsl);
-        @test PkgUtility.FT_test(treet, FT);
-        @test PkgUtility.NaN_test(treet);
-
-        for _plant in [grass, palm, tree]
-            flow_profile!(_plant);
-            pressure_profile!(_plant, SteadyStateMode(); update=true);
-            @test PkgUtility.FT_test(_plant, FT);
-            @test PkgUtility.NaN_test(_plant);
-        end
-
-        inititialize_legacy!(grass);
-        inititialize_legacy!(palm);
-        inititialize_legacy!(tree);
-        inititialize_legacy!(treet);
-        @test PkgUtility.FT_test(treet, FT);
-        @test PkgUtility.NaN_test(treet);
-    end
-end
-
-
-
-# FT and NaN test
-println("\nTesting the temperature functions...")
-@testset "Hydraulics --- temperature functions" begin
-    for FT in [Float32, Float64]
-        leaf  = LeafHydraulics{FT}();
-        root  = RootHydraulics{FT}();
-        treet = TreeSimple{FT}();
-        grass = create_grass(FT(-2.1), FT(0.5), FT[0,-1,-2,-3], collect(FT,0:1:20));
-        palm  = create_palm(FT(-2.1), FT(5.5), FT(6), FT[0,-1,-2,-3], collect(FT,0:1:20));
-        tree  = create_tree(FT(-2.1), FT(5.5), FT(6), FT[0,-1,-2,-3], collect(FT,0:1:20));
-        T     = rand(FT) + 298;
-
-        # test the temperature functions
-        temperature_effects!(treet);
-        temperature_effects!(grass);
-        temperature_effects!(palm );
-        temperature_effects!(tree );
-        temperature_effects!(leaf, T);
-        temperature_effects!(root, T);
-
-        for dataset in [leaf, root, treet, grass, palm, tree]
-            @test PkgUtility.FT_test(dataset, FT);
-            @test PkgUtility.NaN_test(dataset);
-        end
-    end
-end
-
-
-
-# FT and NaN test
-println("\nTesting the root-related functions...")
-@testset "Hydraulics --- root-related functions" begin
-    for FT in [Float32, Float64]
-        root  = RootHydraulics{FT}();
-        grass = create_grass(FT(-2.1), FT(0.5), collect(FT,0:-0.5:-3.0), collect(FT,0:1:20));
-
-        # test the root q functions
-        _p1 = FT(0)
-        _p2 = FT(-0.5)
-        _p3 = FT(-1.0)
-        for result in [ xylem_flow(root, _p1),
-                        xylem_flow(root, _p2),
-                        xylem_flow(root, _p3) ]
-            @test PkgUtility.FT_test(result, FT);
-            @test PkgUtility.NaN_test(result);
-        end
-
-        # test the root qs from q functions
-        _f0 = FT(0);
-        _f1 = FT(0.1);
-        _f2 = FT(0.5);
-        _ks = zeros(FT, 5);
-        _ps = zeros(FT, 5);
-        _qs = zeros(FT, 5);
-        for _f in [_f0, _f1, _f2]
-            roots_flow!(grass.roots, _ks, _ps, _qs, _f);
-            @test PkgUtility.FT_test(grass, FT);
-            @test PkgUtility.NaN_test(grass);
-        end
-
-        # test the recalculate_roots_flow function
-        _ks = zeros(FT, 5);
-        _ps = zeros(FT, 5);
-        _qs = zeros(FT, 5);
-        roots_flow!(grass.roots, _ks, _ps, _qs, FT(0.5));
-        roots_flow!(grass, FT(0.5));
-        @test PkgUtility.NaN_test(grass);
-    end
-end
-
-
-
-# FT and NaN test
-println("\nTesting the pressure functions...")
-@testset "Hydraulics --- pressure functions" begin
-    for FT in [Float32, Float64]
-        leaf  = LeafHydraulics{FT}();
-        root  = RootHydraulics{FT}();
-        stem  = StemHydraulics{FT}();
-        grass = create_grass(FT(-2.1), FT(0.5), FT[0,-1,-2,-3], collect(FT,0:1:20));
-        palm  = create_palm(FT(-2.1), FT(5.5), FT(6), FT[0,-1,-2,-3], collect(FT,0:1:20));
-        tree  = create_tree(FT(-2.1), FT(5.5), FT(6), FT[0,-1,-2,-3], collect(FT,0:1:20));
-        treet = TreeSimple{FT}();
-
-        # test the end_pressure function
-        _f_1 = FT(0.001)
-        _f_2 = FT(1)
-        for result in [ end_pressure(leaf, _f_1),
-                        end_pressure(leaf, _f_2),
-                        end_pressure(root, _f_1),
-                        end_pressure(root, _f_2),
-                        end_pressure(stem, _f_1),
-                        end_pressure(stem, _f_2) ]
-            @test PkgUtility.FT_test(result, FT);
-            @test PkgUtility.NaN_test(result);
-        end
-
-        # test the end_pressure function for plants
-        for result in [ end_pressure(treet, _f_1),
-                        end_pressure(treet, _f_2),
-                        end_pressure(treet, _f_1, _f_1, FT(0.5)) ]
-            @test PkgUtility.FT_test(result, FT);
-            @test PkgUtility.NaN_test(result);
-        end
-    end
-end
-
-
-
-# FT and NaN test
-println("\nTesting the plant-level functions...")
-@testset "Hydraulics --- plant-level" begin
-    for FT in [Float32, Float64]
-        grass = create_grass(FT(-2.1), FT(0.5), FT[0,-1,-2,-3], collect(FT,0:1:20));
-        palm  = create_palm(FT(-2.1), FT(5.5), FT(6), FT[0,-1,-2,-3], collect(FT,0:1:20));
-        tree  = create_tree(FT(-2.1), FT(5.5), FT(6), FT[0,-1,-2,-3], collect(FT,0:1:20));
-        treet = TreeSimple{FT}();
-
-        # test the critical_flow function
-        for result in [ critical_flow(treet) ]
-            @test PkgUtility.FT_test(result, FT);
-            @test PkgUtility.NaN_test(result);
-        end
-
-        # test the plant conductances
-        plant_conductances!(treet);
-    end
-end
-
-
-
-# FT and NaN test
-println("\nTesting the capacitance functions...")
-@testset "Hydraulics --- capacitance" begin
-    for FT in [Float32, Float64]
-        grass = create_grass(FT(-2.1), FT(0.5), FT[0,-1,-2,-3], collect(FT,0:1:20));
-        palm  = create_palm(FT(-2.1), FT(5.4), FT(8), FT[0,-1,-2,-3], collect(FT,0:1:20));
-        tree  = create_tree(FT(-2.1), FT(5.4), FT(8), FT[0,-1,-2,-3], collect(FT,0:1:20));
-
-        # test the critical_flow function
-        update_PVF!(grass, FT(1)); @test true;
-        update_PVF!(palm , FT(1)); @test true;
-        update_PVF!(tree , FT(1)); @test true;
-        for leaf in tree.leaves
-            leaf.q_out = 2e-3;
-        end
-        update_PVF!(tree , FT(1)); @test true;
-        update_PVF!(tree.roots[1], FT(1e6));
-        update_PVF!(tree.roots[1], FT(1e6), true);
-        update_PVF!(tree.trunk, FT(1e6));
-        update_PVF!(tree.leaves[1], FT(1e6));
-
-        # extra tests
-        p_from_volume(PVCurveSegmented{FT}(), FT(0.9), FT(300));
-        p_from_volume(PVCurveSegmented{FT}(), FT(0.6), FT(300));
-        p_from_volume(PVCurveSegmented{FT}(), FT(0.1), FT(300));
-    end
-end
diff --git a/test/test_SPAC.jl b/test/test_SPAC.jl
deleted file mode 100644
index 09ed8f43..00000000
--- a/test/test_SPAC.jl
+++ /dev/null
@@ -1,312 +0,0 @@
-# test the structs
-@info "Testing the FT and NaN of the structs...";
-@testset "FT and NaN --- Types" begin
-    for FT in [Float32, Float64]
-        node = SoilPlantAirContinuum.SPACSimple{FT}();
-        @test PkgUtility.FT_test(node, FT);
-        @test PkgUtility.NaN_test(node);
-    end
-end
-
-
-
-
-# test and benchmark the big_leaf_partition!
-println();
-@info "Testing the big_leaf_partition!...";
-@testset "SoilPlantAirContinuum --- big_leaf_partition!" begin
-    for FT in [Float32, Float64]
-        node   = SoilPlantAirContinuum.SPACSimple{FT}();
-        zenith = FT(30);
-        r_all  = FT(1000);
-
-        SoilPlantAirContinuum.big_leaf_partition!(node, zenith, r_all);
-        @test PkgUtility.FT_test(node, FT);
-        @test PkgUtility.NaN_test(node);
-    end
-end
-
-
-
-
-# test the gain_risk_map
-println();
-@info "Testing the gain_risk_map Function...";
-@testset "SoilPlantAirContinuum --- gain_risk_map" begin
-    for FT in [Float32, Float64]
-        node   = SoilPlantAirContinuum.SPACSimple{FT}();
-        photo  = C3CLM(FT);
-        zenith = FT(30);
-        r_all  = FT(1000);
-
-        SoilPlantAirContinuum.big_leaf_partition!(node, zenith, r_all);
-        mat = SoilPlantAirContinuum.gain_risk_map(node, photo);
-        @test PkgUtility.FT_test(mat, FT);
-        @test PkgUtility.NaN_test(mat);
-    end
-end
-
-
-
-
-# test and benchmark the leaf_gas_exchange_nonopt!
-println();
-@info "Testing the leaf_gas_exchange_nonopt! Functions...";
-@testset "SoilPlantAirContinuum --- leaf_gas_exchange_nonopt!" begin
-    for FT in [Float32, Float64]
-        node   = SoilPlantAirContinuum.SPACSimple{FT}();
-        photo  = C3CLM(FT);
-        zenith = FT(30);
-        r_all  = FT(1000);
-        flow   = FT(4);
-        f_sl   = FT(2.5);
-        f_sh   = FT(1.5);
-
-        SoilPlantAirContinuum.big_leaf_partition!(node, zenith, r_all);
-        SoilPlantAirContinuum.leaf_gas_exchange_nonopt!(node, photo, flow);
-        @test PkgUtility.FT_test(node, FT);
-        @test PkgUtility.NaN_test(node);
-        SoilPlantAirContinuum.leaf_gas_exchange_nonopt!(node, photo, f_sl, f_sh);
-        @test PkgUtility.FT_test(node, FT);
-        @test PkgUtility.NaN_test(node);
-    end
-end
-
-
-
-
-# test and benchmark the leaf_gas_exchange!
-println();
-@info "Testing the leaf_gas_exchange! Functions...";
-@testset "SoilPlantAirContinuum --- leaf_gas_exchange!" begin
-    for FT in [Float32, Float64]
-        node   = SoilPlantAirContinuum.SPACSimple{FT}();
-        photo  = C3CLM(FT);
-        zenith = FT(30);
-        r_all  = FT(1000);
-        flow   = FT(4);
-        f_sl   = FT(2.5);
-        f_sh   = FT(1.5);
-
-        SoilPlantAirContinuum.big_leaf_partition!(node, zenith, r_all);
-        SoilPlantAirContinuum.leaf_gas_exchange!(node, photo, flow);
-        @test PkgUtility.FT_test(node, FT);
-        @test PkgUtility.NaN_test(node);
-        SoilPlantAirContinuum.leaf_gas_exchange!(node, photo, f_sl, f_sh);
-        @test PkgUtility.FT_test(node, FT);
-        @test PkgUtility.NaN_test(node);
-    end
-end
-
-
-
-
-# test and benchmark the leaf_temperature*
-println();
-@info "Testing the leaf_temperature* Functions...";
-@testset "SoilPlantAirContinuum --- leaf_temperature*" begin
-    for FT in [Float32, Float64]
-        node = SoilPlantAirContinuum.SPACSimple{FT}();
-        rad  = FT(300);
-        flow = FT(4);
-
-        for result in [ SoilPlantAirContinuum.leaf_temperature(node, rad, flow),
-                        SoilPlantAirContinuum.leaf_temperature_shaded(node, rad, flow),
-                        SoilPlantAirContinuum.leaf_temperature_sunlit(node, rad, flow) ]
-            @test PkgUtility.FT_test(result, FT);
-            @test PkgUtility.NaN_test(result);
-        end
-    end
-end
-
-
-
-
-# test and benchmark the optimize_flows!
-println();
-@info "Testing the optimize_flows! Functions...";
-@testset "SoilPlantAirContinuum --- optimize_flows!" begin
-    for FT in [Float32, Float64]
-        node   = SoilPlantAirContinuum.SPACSimple{FT}();
-        photo  = C3CLM(FT);
-        zenith = FT(30);
-        r_all  = FT(1000);
-
-        SoilPlantAirContinuum.big_leaf_partition!(node, zenith, r_all);
-        SoilPlantAirContinuum.optimize_flows!(node, photo);
-        @test PkgUtility.FT_test(node, FT);
-        @test PkgUtility.NaN_test(node);
-    end
-end
-
-
-
-
-# test and benchmark the atmosheric* functions
-println();
-@info "Testing the atmosheric* Functions...";
-@testset "SoilPlantAirContinuum --- atmosheric*" begin
-    for FT in [Float32, Float64]
-        h = FT(1000);
-
-        for result in [ SoilPlantAirContinuum.atmospheric_pressure(h),
-                        SoilPlantAirContinuum.atmospheric_pressure_ratio(h),
-                        SoilPlantAirContinuum.ppm_to_Pa(h) ]
-            @test PkgUtility.FT_test(result, FT);
-            @test PkgUtility.NaN_test(result);
-        end
-    end
-end
-
-
-
-
-# test and benchmark the zenith_angle
-println();
-@info "Testing the zenith_angle Functions...";
-@testset "SoilPlantAirContinuum --- zenith_angle" begin
-    for FT in [Float32, Float64]
-        latd = FT(10);
-        decd = FT(10);
-        lhad = FT(10);
-        day  = FT(100)
-        hour = FT(13)
-        minu = FT(30)
-
-        for result in [ SoilPlantAirContinuum.zenith_angle(latd, decd, lhad),
-                        SoilPlantAirContinuum.zenith_angle(latd, day, hour),
-                        SoilPlantAirContinuum.zenith_angle(latd, day, hour, minu) ]
-            @test PkgUtility.FT_test(result, FT);
-            @test PkgUtility.NaN_test(result);
-        end
-    end
-end
-
-
-
-
-# test and benchmark the annual_profit
-println();
-@info "Testing the annual_profit Functions...";
-@testset "SoilPlantAirContinuum --- annual_profit" begin
-    arti = artifact"2020_leaf_invest_weather" * "/gs_sample.csv";
-    weat = read_csv(arti);
-    for FT in [Float32, Float64]
-        node    = SoilPlantAirContinuum.SPACSimple{FT}();
-        photo   = C3CLM(FT);
-        weatmat = Matrix{FT}(weat);
-
-        gscp = SoilPlantAirContinuum.annual_profit(node, photo, weatmat);
-        @test PkgUtility.FT_test(gscp, FT);
-        @test PkgUtility.NaN_test(gscp);
-    end
-end
-
-
-
-
-# test and benchmark the annual_simulation!
-println();
-@info "Testing annual_simulation! Functions...";
-@testset "SoilPlantAirContinuum --- annual_simulation!" begin
-    arti = artifact"2020_leaf_invest_weather" * "/gs_sample.csv";
-    weat = read_csv(arti);
-    for FT in [Float32, Float64]
-        node  = SoilPlantAirContinuum.SPACSimple{FT}();
-        photo = C3CLM(FT);
-        df    = SoilPlantAirContinuum.create_dataframe(FT, weat);
-
-        SoilPlantAirContinuum.annual_simulation!(node, photo, weat, df);
-        @test PkgUtility.FT_test(node, FT);
-        @test PkgUtility.NaN_test(node);
-    end
-end
-
-
-
-
-# test and benchmark the leaf_allocation!
-println();
-@info "Testing the leaf_allocation! Functions...";
-@testset "SoilPlantAirContinuum --- leaf_allocation!" begin
-    for FT in [Float32, Float64]
-        node  = SoilPlantAirContinuum.SPACSimple{FT}();
-        photo = C3CLM(FT);
-        laba  = FT(1000);
-        vmax  = FT(80);
-
-        SoilPlantAirContinuum.leaf_allocation!(node, laba);
-        @test PkgUtility.FT_test(node, FT);
-        @test PkgUtility.NaN_test(node);
-        SoilPlantAirContinuum.leaf_allocation!(node, photo, vmax);
-        @test PkgUtility.FT_test(node, FT);
-        @test PkgUtility.NaN_test(node);
-        SoilPlantAirContinuum.leaf_allocation!(node, photo, laba, vmax);
-        @test PkgUtility.FT_test(node, FT);
-        @test PkgUtility.NaN_test(node);
-    end
-end
-
-
-
-
-# test and benchmark the optimize_leaf
-println();
-@info "Testing the optimize_leaf! Functions...";
-@testset "SoilPlantAirContinuum --- optimize_leaf!" begin
-    arti = artifact"2020_leaf_invest_weather" * "/gs_sample.csv";
-    weat = read_csv(arti);
-    for FT in [Float32, Float64]
-        node    = SoilPlantAirContinuum.SPACSimple{FT}();
-        photo   = C3CLM(FT);
-        weatmat = Matrix{FT}(weat);
-
-        SoilPlantAirContinuum.optimize_leaf!(node, photo, weatmat);
-        @test PkgUtility.FT_test(node, FT);
-        @test PkgUtility.NaN_test(node);
-    end
-end
-
-
-
-
-# test the function to vary SPACSimple
-println();
-@info "Testing the vary_spac! Functions...";
-@testset "SoilPlantAirContinuum --- vary_spac!" begin
-    arti = artifact"2020_leaf_invest_weather" * "/gs_sample.csv";
-    weat = read_csv(arti);
-    facs = ["kl", "kw", "wb", "wc", "wk", "cc", "cv", "gm", "ga", "sd", "ta", "rh", "ca"];
-    for FT in [Float32, Float64]
-        node = SoilPlantAirContinuum.SPACSimple{FT}();
-        for _fac in facs
-            SoilPlantAirContinuum.vary_spac!(node, weat, _fac, FT(1.5));
-            @test true;
-        end
-    end
-end
-
-
-
-
-# test the function for mSCOPE version radiation
-println();
-@info "Testing the mSCOPE verion setup...";
-@testset "SoilPlantAirContinuum --- vary_spac!" begin
-    for FT in [Float32, Float64]
-        node = SoilPlantAirContinuum.SPACMono{FT}();
-        SoilPlantAirContinuum.initialize_spac_canopy!(node);
-        SoilPlantAirContinuum.layer_fluxes!(node);
-        SoilPlantAirContinuum.layer_fluxes!(node, FT(30));
-        @test PkgUtility.NaN_test(node);
-
-        SoilPlantAirContinuum.update_Cab!(node, FT(30));
-        SoilPlantAirContinuum.update_Kmax!(node, FT(1));
-        SoilPlantAirContinuum.update_LAI!(node, FT(3));
-        SoilPlantAirContinuum.update_VJR!(node, FT(0.5));
-        SoilPlantAirContinuum.update_VJRWW!(node, FT(50));
-        SoilPlantAirContinuum.update_Weibull!(node, FT(3));
-        SoilPlantAirContinuum.update_Weibull!(node, FT(3), FT(0.9));
-        @test true;
-    end
-end
diff --git a/test/test_StomataModels.jl b/test/test_StomataModels.jl
deleted file mode 100644
index 6cbb290d..00000000
--- a/test/test_StomataModels.jl
+++ /dev/null
@@ -1,243 +0,0 @@
-# test the structures
-@info "Testing FT and NaN for the structures...";
-@testset "StomtaModels --- structures" begin
-    for FT in [Float32, Float64]
-        can_3 = CanopyLayer{FT}(n_leaf=2);
-        esm_1 = ESMBallBerry{FT}();
-        esm_2 = ESMGentine{FT}();
-        esm_3 = ESMLeuning{FT}();
-        esm_4 = ESMMedlyn{FT}();
-        osm_1 = OSMEller{FT}();
-        osm_2 = OSMSperry{FT}();
-        osm_3 = OSMWang{FT}();
-        osm_4 = OSMWAP{FT}();
-        osm_5 = OSMWAPMod{FT}();
-
-        # test the structures
-        for result in [ can_3, esm_1, esm_2, esm_3, esm_4, osm_4, osm_5 ]
-            @test PkgUtility.FT_test(result, FT);
-            @test PkgUtility.NaN_test(result);
-        end
-    end
-end
-
-
-
-# test the structures
-println();
-@info "Testing gas exchange functions...";
-@testset "StomtaModels --- gas exchange functions" begin
-    for FT in [Float32, Float64]
-        envir  = AirLayer{FT}();
-        leaf_3 = Leaf{FT}();
-        leaf_4 = Leaf{FT}();
-        mod_3  = C3CLM(FT);
-        mod_4  = C4CLM(FT);
-        rand_T = rand(FT) + 298;
-        can_3  = CanopyLayer{FT}(n_leaf=2);
-        can_4  = CanopyLayer{FT}(n_leaf=2);
-        esm_1  = ESMBallBerry{FT}();
-        esm_2  = ESMGentine{FT}();
-        esm_3  = ESMLeuning{FT}();
-        esm_4  = ESMMedlyn{FT}();
-        osm_1  = OSMEller{FT}();
-        osm_2  = OSMSperry{FT}();
-        osm_3  = OSMWang{FT}();
-        osm_4  = OSMWAP{FT}();
-        osm_5  = OSMWAPMod{FT}();
-        hs     = LeafHydraulics{FT}();
-
-        # test the refresh functions
-        update_leaf_TP!(mod_3, can_3, hs, envir);
-        update_leaf_TP!(mod_4, can_4, hs, envir);
-        @test PkgUtility.NaN_test(can_3);
-        @test PkgUtility.NaN_test(can_4);
-
-        update_leaf_AK!(mod_3, can_3, hs, envir);
-        update_leaf_AK!(mod_4, can_4, hs, envir);
-        @test PkgUtility.NaN_test(can_3);
-        @test PkgUtility.NaN_test(can_4);
-
-        gas_exchange!(mod_3, can_3, envir, GlcDrive(), 1, FT(0.1));
-        gas_exchange!(mod_4, can_4, envir, GlcDrive(), 1, FT(0.1));
-        @test PkgUtility.NaN_test(can_3);
-        @test PkgUtility.NaN_test(can_4);
-
-        gas_exchange!(mod_3, can_3, envir, GswDrive(), 1, FT(0.05));
-        gas_exchange!(mod_4, can_4, envir, GswDrive(), 1, FT(0.05));
-        @test PkgUtility.NaN_test(can_3);
-        @test PkgUtility.NaN_test(can_4);
-
-        can_3.g_sw[2] = 0;
-        can_4.g_sw[2] = 0;
-        gsw_control!(mod_3, can_3, envir, 2);
-        gsw_control!(mod_4, can_4, envir, 2);
-        @test PkgUtility.NaN_test(can_3);
-        @test PkgUtility.NaN_test(can_4);
-    end
-end
-
-
-
-# test the structures
-println();
-@info "Testing empirical formulations...";
-@testset "StomtaModels --- empirical formulations" begin
-    for FT in [Float32, Float64]
-        envir  = AirLayer{FT}();
-        leaf_3 = Leaf{FT}();
-        leaf_4 = Leaf{FT}();
-        mod_3  = C3CLM(FT);
-        mod_4  = C4CLM(FT);
-        rand_T = rand(FT) + 298;
-        can_3  = CanopyLayer{FT}(n_leaf=2);
-        can_4  = CanopyLayer{FT}(n_leaf=2);
-        esm_1  = ESMBallBerry{FT}();
-        esm_2  = ESMGentine{FT}();
-        esm_3  = ESMLeuning{FT}();
-        esm_4  = ESMMedlyn{FT}();
-        osm_1  = OSMEller{FT}();
-        osm_2  = OSMSperry{FT}();
-        osm_3  = OSMWang{FT}();
-        osm_4  = OSMWAP{FT}();
-        osm_5  = OSMWAPMod{FT}();
-        hs     = LeafHydraulics{FT}();
-
-        # test the empirical model formulations
-        for result in [ stomatal_conductance(esm_1, leaf_3, envir, FT(1)),
-                        stomatal_conductance(esm_2, leaf_3, envir, FT(1)),
-                        stomatal_conductance(esm_3, leaf_3, envir, FT(1)),
-                        stomatal_conductance(esm_4, leaf_3, envir, FT(1)),
-                        stomatal_conductance(esm_1, can_3, envir, FT(1)),
-                        stomatal_conductance(esm_2, can_3, envir, FT(1)),
-                        stomatal_conductance(esm_3, can_3, envir, FT(1)),
-                        stomatal_conductance(esm_4, can_3, envir, FT(1)),
-                        stomatal_conductance(esm_1, can_3, envir, FT(1), 1),
-                        stomatal_conductance(esm_2, can_3, envir, FT(1), 1),
-                        stomatal_conductance(esm_3, can_3, envir, FT(1), 1),
-                        stomatal_conductance(esm_4, can_3, envir, FT(1), 1) ]
-            @test PkgUtility.FT_test(result, FT);
-            @test PkgUtility.NaN_test(result);
-        end
-    end
-end
-
-
-
-# test the structures
-println();
-@info "Testing stomatal models...";
-@testset "StomtaModels --- stomatal models" begin
-    for FT in [Float32, Float64]
-        envir  = AirLayer{FT}();
-        leaf_3 = Leaf{FT}();
-        leaf_4 = Leaf{FT}();
-        mod_3  = C3CLM(FT);
-        mod_4  = C4CLM(FT);
-        rand_T = rand(FT) + 298;
-        can_3  = CanopyLayer{FT}(n_leaf=2);
-        can_4  = CanopyLayer{FT}(n_leaf=2);
-        esm_1  = ESMBallBerry{FT}();
-        esm_2  = ESMGentine{FT}();
-        esm_3  = ESMLeuning{FT}();
-        esm_4  = ESMMedlyn{FT}();
-        osm_1  = OSMEller{FT}();
-        osm_2  = OSMSperry{FT}();
-        osm_3  = OSMWang{FT}();
-        osm_4  = OSMWAP{FT}();
-        osm_5  = OSMWAPMod{FT}();
-        hs     = LeafHydraulics{FT}();
-        svc    = VanGenuchten{FT}();
-
-        # test the solution functions
-        for (mod,can) in zip([mod_3, mod_4], [can_3, can_4])
-            for sm in [esm_1, esm_2, esm_3, esm_4]
-                for result in [ solution_diff!(FT(0.1), mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearPleaf{FT}(), GlcDrive(), 1),
-                                solution_diff!(FT(0.1), mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearPsoil{FT}(), GlcDrive(), 1),
-                                solution_diff!(FT(0.1), mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearSWC{FT}(), GlcDrive(), 1),
-                                solution_diff!(FT(0.1), mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearPleaf{FT}(), GlcDrive(), 1),
-                                solution_diff!(FT(0.1), mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearPsoil{FT}(), GlcDrive(), 1),
-                                solution_diff!(FT(0.1), mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearSWC{FT}(), GlcDrive(), 1),
-                                ]
-                    @test PkgUtility.FT_test(result, FT);
-                    @test PkgUtility.NaN_test(result);
-                end
-            end
-            for sm in [osm_1, osm_2, osm_3, osm_4, osm_5]
-                result = solution_diff!(FT(0.1), mod, can, hs, envir, sm, GlcDrive(), 1);
-                @test PkgUtility.FT_test(result, FT);
-                @test PkgUtility.NaN_test(result);
-            end
-        end
-
-        # test the stomata solutions
-        for (mod,can) in zip([mod_3, mod_4], [can_3, can_4])
-            for sm in [esm_1, esm_2, esm_3, esm_4]
-                gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearKleaf{FT}(), 1);
-                @test PkgUtility.NaN_test(can);
-                gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearKsoil{FT}(), 1);
-                @test PkgUtility.NaN_test(can);
-                gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearPleaf{FT}(), 1);
-                @test PkgUtility.NaN_test(can);
-                gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearPsoil{FT}(), 1);
-                @test PkgUtility.NaN_test(can);
-                gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearSWC{FT}(), 1);
-                @test PkgUtility.NaN_test(can);
-                gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearKleaf{FT}(), 1);
-                @test PkgUtility.NaN_test(can);
-                gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearKsoil{FT}(), 1);
-                @test PkgUtility.NaN_test(can);
-                gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearPleaf{FT}(), 1);
-                @test PkgUtility.NaN_test(can);
-                gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearPsoil{FT}(), 1);
-                @test PkgUtility.NaN_test(can);
-                gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearSWC{FT}(), 1);
-                @test PkgUtility.NaN_test(can);
-            end
-            for sm in [osm_1, osm_2, osm_3, osm_4, osm_5]
-                gas_exchange!(mod, can, hs, envir, sm, 1);
-                @test PkgUtility.NaN_test(can);
-            end
-            gas_exchange!(mod, can, TreeSimple{FT}(), envir, osm_3);
-            @test PkgUtility.NaN_test(can);
-        end
-
-        for (mod,can) in zip([mod_3, mod_4], [can_3, can_4])
-            for sm in [esm_1, esm_2, esm_3, esm_4]
-                gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearKleaf{FT}());
-                @test PkgUtility.NaN_test(can);
-                gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearKsoil{FT}());
-                @test PkgUtility.NaN_test(can);
-                gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearPleaf{FT}());
-                @test PkgUtility.NaN_test(can);
-                gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearPsoil{FT}());
-                @test PkgUtility.NaN_test(can);
-                gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaGLinearSWC{FT}());
-                @test PkgUtility.NaN_test(can);
-                gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearKleaf{FT}());
-                @test PkgUtility.NaN_test(can);
-                gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearKsoil{FT}());
-                @test PkgUtility.NaN_test(can);
-                gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearPleaf{FT}());
-                @test PkgUtility.NaN_test(can);
-                gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearPsoil{FT}());
-                @test PkgUtility.NaN_test(can);
-                gas_exchange!(mod, can, hs, svc, FT(-1), FT(0.4), envir, sm, BetaVLinearSWC{FT}());
-                @test PkgUtility.NaN_test(can);
-            end
-            for sm in [osm_1, osm_2, osm_3, osm_4, osm_5]
-                gas_exchange!(mod, can, hs, envir, sm);
-                @test PkgUtility.NaN_test(can);
-            end
-        end
-
-        # test the nighttime stomatal conductance solution for Wang model
-        can_3.APAR[1] = 0;
-        gas_exchange!(mod_3, can_3, hs, envir, osm_3);
-
-        # test the prognostic g_sw functions
-        prognostic_gsw!(can_3, envir, esm_1, FT(1), FT(120));
-        prognostic_gsw!(mod_3, can_3, hs, envir, osm_3, FT(120));
-        @test true;
-    end
-end