Skip to content

negative theta in pedo transfer function#111

Merged
cenlinhe merged 5 commits intoNCAR:developfrom
tslin2:develop
Jan 18, 2024
Merged

negative theta in pedo transfer function#111
cenlinhe merged 5 commits intoNCAR:developfrom
tslin2:develop

Conversation

@tslin2
Copy link
Collaborator

@tslin2 tslin2 commented Jan 18, 2024

PR to fix this
#110

+ sr2006_psi_e_c

theta_33 = max(10.0**-5.0,theta_33) ! For numerical stability
theta_1500 = max(10.0**-5.0,theta_1500) ! For numerical stability
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this may cause another issue that log(theta_33) - log(theta_1500) = 0 and then bexp = xx/ 0, leading to floating issue. maybe set different min values for theta_33 and theta_1500 with theta_1500 having a smaller min value to ensure log(theta_33) - log(theta_1500) > 0.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right. I have updated. Thanks

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the typical range of theta_33? Would 1e-3 be too large for the min value of theta_33? Similarly for theta_1500. For example, do we need to make their min values smaller, e.g., min(theta_33) = 1e-5, and min(theta_1500) = 1e-6?

Copy link
Collaborator Author

@tslin2 tslin2 Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

theta_1500 is the wilting point, and theta_33 is the field capacity.

The general range for the wilting point is 0.01-0.3, and for field capacity, it is 0.05-0.4

1e-5 is very small, with almost no soil moisture condition. If think about the table value for different soil types, the minimum value has 0.006 wilting point and 0.10 field capacity, except for water.

Also, there is another constraint at the end of this code, that use 0.17 and 0.01 for field capacity and wilting point, respectively.

smcref = max(0.17 ,min(smcref, smcmax))

smcwlt = max(0.01 ,min(smcwlt, smcref))

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the clarification. This makes sense to me. Your current values look good then.

Copy link
Collaborator

@cenlinhe cenlinhe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bug fix is to add constraints to the intermediate variables to avoid unreasonable extreme values to occur.

@cenlinhe
Copy link
Collaborator

@CharlesZheZhang Can you take a look at this PR and approve it?

Copy link
Collaborator

@CharlesZheZhang CharlesZheZhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR looks good to me. Thanks.

@cenlinhe cenlinhe merged commit 8a9543a into NCAR:develop Jan 18, 2024
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.

3 participants