ClimaLand.jl
ClimaLand.jl copied to clipboard
Roundoff error in two stream scheme
Describe the bug
We get incorrect absorbed/reflected/transmitted radiation from plant_absorbed_pfd
for both of our radiation schemes when the zenith angle is pi/2 or the sun is below the horizon, and when LAI is very small. This is because we have things like:
K = 1/cos(theta), where theta = zenith angle
and exp(-K*LAI)
We should be able to remove the LAI clipping done in the global run once we do this.
For now, I clip LAI in the TimeVaryingInput so that if LAI < 0.05, LAI = 0 exactly. Then exp(-K*LAI) =1.
To Reproduce
see failing test in kd/radiation_roundoff_bug