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.
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.