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
keyword_keepgit
type_code improvement
| by inh599The 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. insideDO k<ITERMAX
andDO i=1,mp
loopsgswmin
is set by the lineat line 2136. Hence at the end of the DO i loop the full array of
gswmin
takes the value ofveg%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
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