NGEET / fates

repository for the Functionally Assembled Terrestrial Ecosystem Simulator (FATES)
Other
105 stars 92 forks source link

remote but possible singularity in two-stream code #1276

Open rgknox opened 3 weeks ago

rgknox commented 3 weeks ago

We have some code that avoids a mathematical singularity in two-stream, see here:

https://github.com/NGEET/fates/blob/main/radiation/TwoStreamMLPEMod.F90#L952-L977

I just realized that it's possible that a correction that is applied to prevent a singularity in the NIR band (second loop index) could actually generate conditions for a singularity in the visible band (the first loop index).

This seems incredibly unlikely, but when you do this billions of times in and ESM, a one in a billion probability could crash your model.