Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 8, 2024
1 parent 769f83a commit 242f075
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
1 change: 0 additions & 1 deletion docs/source/api/demography_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.16.4
kernelspec:
display_name: Python 3
language: python
Expand Down
17 changes: 16 additions & 1 deletion docs/source/users/tmodel/canopy.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ jupytext:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.16.4
kernelspec:
display_name: python3
language: python
Expand Down Expand Up @@ -60,9 +59,13 @@ pft.height
```

```{code-cell}
:lines_to_next_cell: 2
pft.crown_area
```

+++ {"lines_to_next_cell": 2}

### Crown shape

Jaideep's extension of the T Model adds a crown shape model, driven by two parameters
Expand Down Expand Up @@ -95,6 +98,8 @@ r_0 &= \frac{1}{q_m}\sqrt{\frac{A_c}{\pi}}
$$

```{code-cell}
:lines_to_next_cell: 2
def calculate_qm(m, n):
# Constant q_m
Expand Down Expand Up @@ -128,6 +133,8 @@ print("zm = ", zm)
print("r0 = ", r0)
```

+++ {"lines_to_next_cell": 2}

The following functions then provide the value at height $z$ of relative $q(z)$ and
actual $r(z)$ canopy radius:

Expand Down Expand Up @@ -275,6 +282,8 @@ The code below calculates the projected crown area for each stem and then plots
vertical profile for individual stems and across the community.

```{code-cell}
:lines_to_next_cell: 2
# Calculate the projected area for each stem
Ap_z = calculate_projected_area(z=z[:, None], pft=pft, m=m, n=n, qm=qm, zm=zm)
Expand All @@ -293,6 +302,8 @@ ax2.set_xlabel("Total community $A_p(z)$ (m2)")
plt.tight_layout()
```

+++ {"lines_to_next_cell": 2}

### Canopy closure and canopy gap fraction

The total cumulative projected area shown above is modified by a community-level
Expand Down Expand Up @@ -478,12 +489,16 @@ print(Ap_z_star)
```

```{code-cell}
:lines_to_next_cell: 2
# Calculate the contribution _within_ each layer per stem
Ap_within_layer = np.diff(Ap_z_star, axis=0, prepend=0)
print(Ap_within_layer)
```

+++ {"lines_to_next_cell": 2}

### Leaf area within canopy layers

The projected area occupied by leaves at a given height $\tilde{A}_{cp}(z)$ is
Expand Down

0 comments on commit 242f075

Please sign in to comment.