Skip to content

6/8 Use the published VPRM W_scale for every class - #43

Open
Timothy-W-Hilton wants to merge 1 commit into
tglauch:mainfrom
Timothy-W-Hilton:fix-published-w-scale
Open

6/8 Use the published VPRM W_scale for every class#43
Timothy-W-Hilton wants to merge 1 commit into
tglauch:mainfrom
Timothy-W-Hilton:fix-published-w-scale

Conversation

@Timothy-W-Hilton

Copy link
Copy Markdown

Use the published VPRM W_scale for every class

Summary

Use the W_scale formulation from Mahadevan et al. (2008), Eq. 8, for all VPRM land-cover classes:

W_scale = (1 + LSWI) / (1 + max_LSWI)

Problem

vprm_base_model.get_w_scale() previously used a different expression for classes 4 and 7:

(LSWI - min_LSWI) / (max_LSWI - min_LSWI)

That denominator can become extremely small where the annual LSWI range is small (i.e. max_LSWI and min_LSWI are close to one another), producing very large or non-finite W_scale values. This happened frequently in grassland and shrubland cells during New Zealand runs.

Change

  • Apply the published Eq. 8 form consistently to every class.
  • Retain land_cover_type in the method signature for API compatibility.
  • Document the scientific rationale in the method docstring.
  • Add a regression test using a former special-case class with nearly equal annual LSWI extrema; it verifies the result is finite and matches Eq. 8.

Validation

tests/test_w_scale.py: 1 passed
full discovered test suite on this branch: 1 passed

Apply Mahadevan et al. (2008) Eq. 8, (1 + LSWI) / (1 + max_LSWI), for
every land-cover class. The replaced equation can blow up toward +/-
infinity if LSWI, min_lswi, and/or max_lswi are close to one another.
This can happen in places with a small annual cycle. Add regression
coverage for a nearly constant LSWI case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant