CABLE-LSM / CABLE-Trac-archive

Archive CABLE Trac contents as issues
Other
0 stars 0 forks source link

Misplaced brackets in fwsoil equation #236

Open penguian opened 4 years ago

penguian commented 4 years ago

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 commented 4 years ago

@mgk576@nci.org.au 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 commented 4 years ago

@jxs599@nci.org.au set milestone to 6. Report

penguian commented 1 year ago

@ccc561@nci.org.au 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 commented 1 year ago

@jxs599@nci.org.au commented


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

penguian commented 1 year ago

@ccc561@nci.org.au set keywords to keepgit