CABLE-LSM / CABLE

Home to the CABLE land surface model and its documentation
https://cable.readthedocs.io/en/latest/
Other
12 stars 6 forks source link

bug in Medlyn specification of gswmin #183

Open penguian opened 3 years ago

penguian commented 3 years ago

keyword_keepgit type_code improvement | by inh599


The Medlyn model for stomatal conductance, in the DryLeaf subroutine of cable_canopy, has a bug in its implementation. This leads to notable efficiency issues (Thatcher) and potentially numerical errors if input parameter values are varied.

further details and suggested fix

gswmin is ALLOCATED to be an (mp,mf) local variable at line 1874. inside DO k<ITERMAX and DO i=1,mp loops gswmin is set by the line

       gswmin = veg%g0(i)

at line 2136. Hence at the end of the DO i loop the full array of gswmin takes the value of veg%g0(mp). veg%g0 for different PFT/surface types are therefore mixed up and the results are not independent of tile ordering.

The simple fix is to replace the line above with

    gswmin(i,:) = veg%g0(i)

This also will improve efficiency by removing the (redundant) implicit looping over mf in the original code.

Existing results, including ACCESS-CM2 CMIP simulations, that use the default values for vegin%g0 are not impacted by this bug since vegin%g0=0 for all PFTs (vegetated and non-vegetated surface types)


Issue migrated from trac:308 at 2023-11-27 11:38:57 +1100

penguian commented 1 year ago

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