Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

single scattering albedo method in ArtReflectPure #505

Open
HajimeKawahara opened this issue Aug 4, 2024 · 2 comments
Open

single scattering albedo method in ArtReflectPure #505

HajimeKawahara opened this issue Aug 4, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@HajimeKawahara
Copy link
Owner

I found that in some case, trans_coeff in the flux-adding reflection scheme becomes nan.

@HajimeKawahara HajimeKawahara self-assigned this Aug 4, 2024
@HajimeKawahara HajimeKawahara added the bug Something isn't working label Aug 4, 2024
@HajimeKawahara HajimeKawahara added this to the v1.6 milestone Aug 4, 2024
@HajimeKawahara
Copy link
Owner Author

HajimeKawahara commented Aug 4, 2024

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.

@HajimeKawahara
Copy link
Owner Author

HajimeKawahara commented Aug 4, 2024

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.

@HajimeKawahara HajimeKawahara changed the title nan trans_coeff treatment single scattering albedo method in ArtReflectPure Aug 4, 2024
@HajimeKawahara HajimeKawahara added enhancement New feature or request and removed bug Something isn't working labels Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant