From 2368a0ba33cf12d6c3331bedaac14b4c8a304a3c Mon Sep 17 00:00:00 2001 From: Michele Guerini Rocco Date: Mon, 4 Nov 2024 10:53:45 +0100 Subject: [PATCH] src/gray_tables.f90: avoid floating point exception Due to Fortran non-shortcircuiting expressions, if info /= 0 and psi_n = NaN or is undefined, it will still raise an exception. --- src/gray_tables.f90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gray_tables.f90 b/src/gray_tables.f90 index ffe60bc..d8c024e 100644 --- a/src/gray_tables.f90 +++ b/src/gray_tables.f90 @@ -410,7 +410,8 @@ contains psi_n = sol(1) ! Handle spurious or no solutions - if (info /= 1 .or. psi_n < 0 .or. psi_n > 1) cycle + if (info /= 1) cycle + if (psi_n < 0 .or. psi_n > 1) cycle end block ! Compute and print the ψ_n(R,z) = ψ_n₀ contour