forked from naddor/fuse
-
Notifications
You must be signed in to change notification settings - Fork 5
Add interception storage decision #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
CyrilThebault
wants to merge
5
commits into
CH-Earth:staging
Choose a base branch
from
CyrilThebault:feature/interception-storage
base: staging
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2545c54
Add interception model decision
CyrilThebault ff4e75e
Add interception state storage
CyrilThebault c8131d0
Add interception storage parameter
CyrilThebault a68724f
fix: honor decisions_file from control file
CyrilThebault 9e05b59
feat: port interception storage to FUSE 2.0
CyrilThebault File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| SUBROUTINE UPDATE_INTERCEPTION(DT) | ||
| ! --------------------------------------------------------------------------------------- | ||
| ! Creator: | ||
| ! -------- | ||
| ! Cyril Thebault, 2026 | ||
| ! --------------------------------------------------------------------------------------- | ||
| ! Purpose: | ||
| ! -------- | ||
| ! Updates the interception store over one forcing interval. | ||
| ! | ||
| ! PIN0 : precipitation entering the interception store [depth/time] | ||
| ! EVAP_0 : evaporation from the interception store [depth/time] | ||
| ! PTHRU : throughfall leaving the interception store [depth/time] | ||
| ! SINT_0 : interception storage [depth] | ||
| ! MAXSINT_0 : maximum interception storage [depth] | ||
| ! --------------------------------------------------------------------------------------- | ||
|
|
||
| USE nrtype | ||
| USE model_defn | ||
| USE model_defnames | ||
| USE multiparam | ||
| USE multiforce, ONLY: MFORCE | ||
| USE multistate | ||
| USE multi_flux | ||
|
|
||
| IMPLICIT NONE | ||
|
|
||
| REAL(WP), INTENT(IN) :: DT | ||
|
|
||
| REAL(WP) :: WATER_AVAILABLE | ||
| REAL(WP) :: WATER_REMAIN | ||
| REAL(WP) :: EVAP_AMOUNT | ||
| REAL(WP) :: PTHRU_AMOUNT | ||
|
|
||
| IF (DT <= 0._wp) THEN | ||
| PRINT *, 'UPDATE_INTERCEPTION: DT must be greater than zero' | ||
| STOP | ||
| END IF | ||
|
|
||
| SELECT CASE(SMODL%iINTRC) | ||
|
|
||
| CASE(iopt_no_intrcep) | ||
|
|
||
| M_FLUX%EVAP_0 = 0._wp | ||
| M_FLUX%PTHRU = M_FLUX%PIN0 | ||
| FSTATE%SINT_0 = 0._wp | ||
|
|
||
| CASE(iopt_gr5h_intrc) | ||
|
|
||
| IF (MPARAM%MAXSINT_0 < 0._wp) THEN | ||
| PRINT *, 'UPDATE_INTERCEPTION: MAXSINT_0 must not be negative' | ||
| STOP | ||
| END IF | ||
|
|
||
| WATER_AVAILABLE = MAX(0._wp, FSTATE%SINT_0) & | ||
| + MAX(0._wp, M_FLUX%PIN0) * DT | ||
|
|
||
| EVAP_AMOUNT = MIN( & | ||
| MAX(0._wp, MFORCE%PET) * DT, & | ||
| WATER_AVAILABLE & | ||
| ) | ||
|
|
||
| WATER_REMAIN = WATER_AVAILABLE - EVAP_AMOUNT | ||
|
|
||
| PTHRU_AMOUNT = MAX( & | ||
| 0._wp, & | ||
| WATER_REMAIN - MPARAM%MAXSINT_0 & | ||
| ) | ||
|
|
||
| FSTATE%SINT_0 = WATER_REMAIN - PTHRU_AMOUNT | ||
|
|
||
| M_FLUX%EVAP_0 = EVAP_AMOUNT / DT | ||
| M_FLUX%PTHRU = PTHRU_AMOUNT / DT | ||
|
|
||
| CASE DEFAULT | ||
|
|
||
| PRINT *, 'SMODL%iINTRC must be iopt_no_intrcep or iopt_gr5h_intrc' | ||
| STOP | ||
|
|
||
| END SELECT | ||
|
|
||
| M_FLUX%EFF_PPT = M_FLUX%PTHRU | ||
|
|
||
| END SUBROUTINE UPDATE_INTERCEPTION | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really think we need to formulate this as an ODE for consistency with the FUSE soil model.
Consider
dS/dt = P - P_thru - E_can
where
S = canopy storage
P = precipitation (mm/day)
E_thru = throughfall (mm/day)
E_can = canopy evaporation (mm/day)
t = time (days)
Your throughfall formulation was
P_thru = 0 if S < Smax
P_thru = P otherwise
This is equivalent to
P_thru = P * phi(S)
where phi(S) = P_thru/P is the fraction of precipitation that passes through the canopy without being intercepted.
phi(S) can be parameterized as a logistic function:
phi(S) = sigma((S-Smax)/k)
where sigma(x) = 1/(1+exp(-x)) and x= (S-Smax)/k
here
Smax is defined as the characteristic interception storage at which half of the incident precipitation becomes throughfall (phi=0.5)
k is a smoothing parameter (units of storage) that controls the sharpness of the transition between complete interception and complete throughfall.
Your canopy evaporation formulation was
E_can = 0 if S=0
E_can = PET otherwise
This is equivalent to
E_can = w(S) * PET
where in your formulation w(S)=0 when S=0 and w(S)=1 otherwise.
We interpret w(S) as the wetted fraction of the canopy, where w(S) partitions potential ET into the energy available for canopy evaporation and soil transpiration (transpiration occurs over the dry fraction of the leaves).
Similar to your formulation, we can replace this discontinuous wetness function with a smooth function of interception storage,
w(S)=S/(S+eps)
where eps is a storage scale parameter controlling the transition from a dry to a fully wetted canopy. Very small values of eps are essentially equivalent to your original step function everywhere except very close to S=0.
since this is a scalar equation it can be solved easily using a safe newton raphson algorithm with bi-section. you can also do this with explicit euler in a way that handles solution constraints.
Note in this formulation that S can be a little bit more than Smax (the amount controlled by the width of the logistic function). Hence we view Smax more of a scaling parameter.