Open HajimeKawahara opened 3 months ago
This is because in some case $\gamma_2 > \gamma_1$, then delta = jnp.sqrt((gamma_1 - gamma_2) / (gamma_1 + gamma_2))
becomes nan
.
See spec.toon.zetalambda_coeffs(gamma_1, gamma_2)
For the hemispheric mean, $\gamma_1 - \gamma_2 = 2 (1 - \omega)$. So, Unless $\omega > 1$, this error does not happen.
In fact, investigating the code, I found
single_scattering_albedo = [1.008468 1.00827063 1.00805159 ... 1.01170891 1.01171055 1.01171209]
when the error occurs.
I found this bug because I used the wrong dtau_cld
and dtau_cld_scat
to compute single_scattering_albedo
. But, this mistake should be avoided by defining the method to compute single_scattering_albedo
in the art
class because it will be likely a typical mistake.
I found that in some case,
trans_coeff
in the flux-adding reflection scheme becomesnan
.