Skip to content
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

Misplaced brackets in fwsoil equation #236

Open
penguian opened this issue Dec 18, 2019 · 5 comments
Open

Misplaced brackets in fwsoil equation #236

penguian opened this issue Dec 18, 2019 · 5 comments

Comments

@penguian
Copy link
Collaborator

keyword_keepgit type_defect | by amu561


In SUBROUTINE fwsoil_calc_std in cable_canopy.F90, the brackets are not placed correctly in this equation:

rwater = MAX(1.0e-9,                                                    &
            SUM(veg%froot * MAX(1.0e-9,MIN(1.0, real(ssnow%wb) -                   &
            SPREAD(soil%swilt, 2, ms))),2) /(soil%sfc-soil%swilt))

The (soil%sfc-soil%swilt) should be within the MIN() statetement. To correct this, the equation can be replaced with:

 rwater = MAX(1.0e-9,                                                    &
           SUM(veg%froot * MAX(1.0e-9, MIN( 1.0, real((ssnow%wb              &
           - SPREAD(soil%swilt, 2, ms))  / (SPREAD(soil%sfc, 2, ms)           &
           - SPREAD(soil%swilt, 2, ms)) ))) , 2))

This leads to a minor correction in fwsoil at soil moisture values above field capacity.


Issue migrated from trac:236 at 2023-11-27 11:30:54 +1100

@penguian
Copy link
Collaborator Author

@[email protected] commented


I spoke to Anna and I think this is just for the groundwater on case. I suggest we separate the steps as it is pretty hard to follow the logic here!

@penguian
Copy link
Collaborator Author

penguian commented Feb 6, 2020

@[email protected] set milestone to 6. Report

@penguian
Copy link
Collaborator Author

penguian commented Feb 1, 2023

@[email protected] commented


If I understand the error, the denominator is constant along the soil layers but it needs to be included in the MIN(), and hence the SUM(). The MIN() should be on the ratio of (wb-swilt)/(sfc-swilt) and not just (wb-swilt).

@penguian
Copy link
Collaborator Author

penguian commented Feb 1, 2023

@[email protected] commented


I'll use Anna's suggestion and close it in the next few days

@penguian
Copy link
Collaborator Author

penguian commented Feb 7, 2023

@[email protected] set keywords to keepgit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant