Two unit-convention findings from the calibration study. Separate defects, filed together because they have the same shape: a conversion the package knows about but leaves in the caller's code, where it is easy to get wrong and expensive when you do.
1. gs is reported only as conductance to CO2
The model reports stom_cond_CO2_. Every data source records conductance to water, and so does the g1 literature. A user comparing against measurements must therefore multiply by the CO2/H2O diffusivity ratio outside the package — and as the calibration put it, if that factor is wrong then gs is biased by a constant and the fit absorbs it into kmax.
That is the worst kind of error to leave to user code: a constant multiplicative bias on one response, which a fit will happily launder into a different parameter rather than reveal.
Ask: report stom_cond_H2O_ alongside stom_cond_CO2_, so the conversion happens once, inside the model, where the ratio is already a named constant.
⚠️ Coupled to #50, which is about that ratio's value — 1.67 here against 1.6 in Medlyn (2011) and the g1 literature. Exposing an H2O conductance without settling #50 would ship the 2.2% convention offset into a second output. Do #50 first, or do them together.
2. The two halves of one hydraulic path are in different unit bases
leaf_specific_conductance_max is kg m⁻² s⁻¹ MPa⁻¹, while SinglePotential's resistance is MPa s mol⁻¹ m². So a caller parameterising the whole soil-to-leaf path — which is exactly what the single-potential path is for — has to carry a kg-per-mol factor between two quantities the package presents as two ends of one series.
The calibration recorded that dropping that factor of 0.018 was its original error and worth three orders of magnitude, which is why it ended up named in their code rather than inlined.
Ask: either put both ends on one basis, or state the mismatch in ?leaf_supply_single next to the argument it bites. The first is a results-moving change and needs a blast-radius statement; the second is free and should happen regardless.
⚠️ Note the constants themselves are already inconsistent — kg_to_mol_h2o and kg_per_mol_h2o are not reciprocals (#51). Whichever basis is chosen here, #51 has to be settled first, or the conversion is done with two constants that disagree at 0.028%.
Why both are worth doing
The single-potential path exists to lower the barrier for a bare-leaf user arriving from plantecophys or tealeaves (#32). Both of these land on exactly that user: they have gs to water and one series resistance, and the package currently asks them to convert both.
Two unit-convention findings from the calibration study. Separate defects, filed together because they have the same shape: a conversion the package knows about but leaves in the caller's code, where it is easy to get wrong and expensive when you do.
1.
gsis reported only as conductance to CO2The model reports
stom_cond_CO2_. Every data source records conductance to water, and so does the g1 literature. A user comparing against measurements must therefore multiply by the CO2/H2O diffusivity ratio outside the package — and as the calibration put it, if that factor is wrong thengsis biased by a constant and the fit absorbs it intokmax.That is the worst kind of error to leave to user code: a constant multiplicative bias on one response, which a fit will happily launder into a different parameter rather than reveal.
Ask: report
stom_cond_H2O_alongsidestom_cond_CO2_, so the conversion happens once, inside the model, where the ratio is already a named constant.2. The two halves of one hydraulic path are in different unit bases
leaf_specific_conductance_maxis kg m⁻² s⁻¹ MPa⁻¹, whileSinglePotential'sresistanceis MPa s mol⁻¹ m². So a caller parameterising the whole soil-to-leaf path — which is exactly what the single-potential path is for — has to carry a kg-per-mol factor between two quantities the package presents as two ends of one series.The calibration recorded that dropping that factor of 0.018 was its original error and worth three orders of magnitude, which is why it ended up named in their code rather than inlined.
Ask: either put both ends on one basis, or state the mismatch in
?leaf_supply_singlenext to the argument it bites. The first is a results-moving change and needs a blast-radius statement; the second is free and should happen regardless.kg_to_mol_h2oandkg_per_mol_h2oare not reciprocals (#51). Whichever basis is chosen here, #51 has to be settled first, or the conversion is done with two constants that disagree at 0.028%.Why both are worth doing
The single-potential path exists to lower the barrier for a bare-leaf user arriving from
plantecophysortealeaves(#32). Both of these land on exactly that user: they havegsto water and one series resistance, and the package currently asks them to convert both.